Commit 675eaa6e authored by Kåre Särs's avatar Kåre Särs
Browse files

S&R: Add UseUnicodePropertiesOption to regexps

To make regular expressions work properly with Unicode add
UseUnicodePropertiesOption option

(Search & Replace plugin)

CCBUG: 433924
CCBUG: 433673
parent dc722b33
......@@ -960,7 +960,8 @@ void KatePluginSearchView::startSearch()
}
QRegularExpression::PatternOptions patternOptions =
(m_ui.matchCase->isChecked() ? QRegularExpression::NoPatternOption : QRegularExpression::CaseInsensitiveOption);
(m_ui.matchCase->isChecked() ? QRegularExpression::UseUnicodePropertiesOption
: QRegularExpression::UseUnicodePropertiesOption | QRegularExpression::CaseInsensitiveOption);
QString pattern = (m_ui.useRegExp->isChecked() ? currentSearchText : QRegularExpression::escape(currentSearchText));
QRegularExpression reg(pattern, patternOptions);
......@@ -1127,7 +1128,8 @@ void KatePluginSearchView::startSearchWhileTyping()
// Now we should have a true typed text change
QRegularExpression::PatternOptions patternOptions =
(m_ui.matchCase->isChecked() ? QRegularExpression::NoPatternOption : QRegularExpression::CaseInsensitiveOption);
(m_ui.matchCase->isChecked() ? QRegularExpression::UseUnicodePropertiesOption
: QRegularExpression::UseUnicodePropertiesOption | QRegularExpression::CaseInsensitiveOption);
QString pattern = (m_ui.useRegExp->isChecked() ? currentSearchText : QRegularExpression::escape(currentSearchText));
QRegularExpression reg(pattern, patternOptions);
if (!reg.isValid()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment