From 48a8481b8563e548054d66ccd3c73fa4964db0fd Mon Sep 17 00:00:00 2001 From: mgrojo Date: Fri, 26 Jul 2019 19:47:02 +0200 Subject: [PATCH] Allow using extended regular expressions in the find dialogs This adds support for searching "this|that" to find either "this" or "that" or using quantifiers like "{number}". The change applies to the Find/Replace dialog and the search bar. See https://en.cppreference.com/w/cpp/regex/ecmascript for details of the syntax. This raises the requirement for an external version of QScintilla to v2.11. See issue #1625 --- src/ExtendedScintilla.cpp | 3 ++- src/FindReplaceDialog.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ExtendedScintilla.cpp b/src/ExtendedScintilla.cpp index 413bf526..597c6f3c 100644 --- a/src/ExtendedScintilla.cpp +++ b/src/ExtendedScintilla.cpp @@ -244,7 +244,8 @@ bool ExtendedScintilla::findText(QString text, bool regexp, bool caseSensitive, } return findFirst(text, regexp, caseSensitive, words, wrap, forward, - /* line */ -1, /* index */ -1, /* show */ true, /* posix */ true); + /* line */ -1, /* index */ -1, + /* show */ true, /* posix */ true, /* cxx11 */ true); } void ExtendedScintilla::setEnabledFindDialog(bool value) diff --git a/src/FindReplaceDialog.cpp b/src/FindReplaceDialog.cpp index f0ecbfd6..45797f37 100644 --- a/src/FindReplaceDialog.cpp +++ b/src/FindReplaceDialog.cpp @@ -54,7 +54,8 @@ bool FindReplaceDialog::findFirst(bool wrap, bool forward) ui->wholeWordsCheckBox->isChecked(), forward, /* show */ true, - /* posix */ true); + /* posix */ true, + /* cxx11 */ true); else return m_scintilla->findFirst (ui->findText->text(), @@ -66,7 +67,8 @@ bool FindReplaceDialog::findFirst(bool wrap, bool forward) /* line */ -1, /* index */ -1, /* show */ true, - /* posix */ true); + /* posix */ true, + /* cxx11 */ true); } bool FindReplaceDialog::findNext()