mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 18:40:13 -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()
|
||||
|
||||
@@ -52,7 +52,9 @@ bool FindReplaceDialog::findFirst(bool wrap, bool forward)
|
||||
ui->regexpCheckBox->isChecked(),
|
||||
ui->caseCheckBox->isChecked(),
|
||||
ui->wholeWordsCheckBox->isChecked(),
|
||||
forward);
|
||||
forward,
|
||||
/* show */ true,
|
||||
/* posix */ true);
|
||||
else
|
||||
return m_scintilla->findFirst
|
||||
(ui->findText->text(),
|
||||
@@ -60,7 +62,11 @@ bool FindReplaceDialog::findFirst(bool wrap, bool forward)
|
||||
ui->caseCheckBox->isChecked(),
|
||||
ui->wholeWordsCheckBox->isChecked(),
|
||||
wrap,
|
||||
forward);
|
||||
forward,
|
||||
/* line */ -1,
|
||||
/* index */ -1,
|
||||
/* show */ true,
|
||||
/* posix */ true);
|
||||
}
|
||||
|
||||
bool FindReplaceDialog::findNext()
|
||||
|
||||
Reference in New Issue
Block a user