X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fexpressionmatch.cpp;h=f9c834aed59f498f1ed9925f8e275051a8379515;hb=02a188baf63969b6e6f14c49d305c79b61a2cb06;hp=73856a381ee1b1be48fcb61a344680a516c92a45;hpb=8c6448c2e0048389fbac9e2e9daf22b5b050d5b6;p=quassel.git diff --git a/src/common/expressionmatch.cpp b/src/common/expressionmatch.cpp index 73856a38..f9c834ae 100644 --- a/src/common/expressionmatch.cpp +++ b/src/common/expressionmatch.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2020 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -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()) {