View Issue Details

IDProjectCategoryView StatusLast Update
0014255ScribusPlug-inspublic2016-08-06 08:57
ReporterDmitriyK Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformWindowsOSWindows 8 
Product Version1.5.2 
Summary0014255: Erroneous behaviour of regular expression in Text Import filter
DescriptionWhen using regular expression with REPLACE option in Text Import filter, the ^ (start of line symbol) causes the regular expression to be ignored. Specifically, ^(\d+\.)\s+ is ignored.

On the contrary, (\d+\.)\s+ works fine (replacement \1\t works along all the text).

As noted in QT5 documentation (https://doc.qt.io/qt-5/qregexp.html), «Note: In Qt 5, the new QRegularExpression class provides a Perl compatible implementation of regular expressions and is recommended in place of QRegExp». Maybe that can resolve the problem?
Steps To Reproduce1. Create a text frame
2. File > Import > Get Text (CTRL-I)
3. Choose a text file with a few lines starting with «1. text».
4. Choose Text Import filter
5. Choose REPLACE
6. Set regular expression checkbox
7. ^(\d+\.)\s+ as search regex
8. \1\t as replace regex
9. OK
10. See the regex being ignored.
Additional InformationAdditionally, setMinimal(true) @L103 of \scribus-1.5.2\scribus\plugins\gettext\textfilter\textfilter.cpp should probably be available as an UI option, since it toggles between greedy/lazy regex which could be useful.
TagsNo tags attached.
PatchNo

Activities

ale

2016-08-06 08:57

manager   ~0041892

a good test file is:

abcd
efghabcd
abcd

and you try to replace ^abc through 000

only the first abc will be replaced but not the last one.

it's very likely that the text filter should enable the multiline option for the rexepx.

Issue History

Date Modified Username Field Change
2016-08-06 08:46 DmitriyK New Issue
2016-08-06 08:57 ale Note Added: 0041892