View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0014255 | Scribus | Plug-ins | public | 2016-08-06 08:46 | 2016-08-06 08:57 |
Reporter | DmitriyK | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | Windows | OS | Windows 8 | ||
Product Version | 1.5.2 | ||||
Summary | 0014255: Erroneous behaviour of regular expression in Text Import filter | ||||
Description | When 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 Reproduce | 1. 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 Information | Additionally, 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. | ||||
Tags | No tags attached. | ||||
Patch | No | ||||