X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fexpressionmatch.cpp;fp=src%2Fcommon%2Fexpressionmatch.cpp;h=f9c834aed59f498f1ed9925f8e275051a8379515;hp=97b7228d7156c69f68374044b52e3420f0f01df6;hb=02a188baf63969b6e6f14c49d305c79b61a2cb06;hpb=614f5948115e94994686e2542df3863ab3b1af2c diff --git a/src/common/expressionmatch.cpp b/src/common/expressionmatch.cpp index 97b7228d..f9c834ae 100644 --- a/src/common/expressionmatch.cpp +++ b/src/common/expressionmatch.cpp @@ -384,10 +384,14 @@ void ExpressionMatch::cacheRegEx() QRegularExpression ExpressionMatch::regExFactory(const QString& regExString, bool caseSensitive) { - // Construct the regular expression object, setting case sensitivity as appropriate - QRegularExpression newRegEx = QRegularExpression(regExString, - caseSensitive ? QRegularExpression::PatternOption::NoPatternOption - : QRegularExpression::PatternOption::CaseInsensitiveOption); + // This is required, else extra-ASCII codepoints get treated as word boundaries + QRegularExpression::PatternOptions options = QRegularExpression::UseUnicodePropertiesOption; + + if (!caseSensitive) { + options |= QRegularExpression::CaseInsensitiveOption; + } + + QRegularExpression newRegEx = QRegularExpression(regExString, options); // Check if rule is valid if (!newRegEx.isValid()) {