mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-02-10 13:48:32 -06:00
Set the POSIX flag in Scintilla regex find
The POSIX flag is passed to QScintilla for stardardisation of the regex implementation. This only changes the syntax for sub-expressions. Before this change it was '\( \)'. With the POSIX flag it is simply '( )' for sub-expressions, consequently \( and \( have to be used for matching parenthesis. Both the Qt implementation (used in filters and REGEXP operator) and the C++11 standard (possibly used in the future for the editor, if QScintilla add support) use the the new syntax for sub-expressions. References: https://en.cppreference.com/w/cpp/regex/syntax_option_type > If no grammar is chosen, ECMAScript is assumed to be selected. https://en.cppreference.com/w/cpp/regex/ecmascript > The Atom ( Disjunction ) is marked subexpression Qt also uses subexpressions in the POSIX style. http://doc.qt.io/qt-5/qregexp.html#capturing-parentheses See issue #1625
This commit is contained in:
@@ -211,7 +211,8 @@ bool ExtendedScintilla::findText(QString text, bool regexp, bool caseSensitive,
|
||||
setCursorPosition(lineFrom, indexFrom);
|
||||
}
|
||||
|
||||
return findFirst(text, regexp, caseSensitive, words, wrap, forward);
|
||||
return findFirst(text, regexp, caseSensitive, words, wrap, forward,
|
||||
/* line */ -1, /* index */ -1, /* show */ true, /* posix */ true);
|
||||
}
|
||||
|
||||
void ExtendedScintilla::clearSelection()
|
||||
|
||||
Reference in New Issue
Block a user