X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fexpressionmatch.cpp;h=4fb16e34663f0ba267ceb3265b3f6c5a142f007a;hp=d1af24f6c71d49eb69b90c3298361685972dabf8;hb=HEAD;hpb=cc6e7c08709c4e761e2fd9c2e322751015497003 diff --git a/src/common/expressionmatch.cpp b/src/common/expressionmatch.cpp index d1af24f6..4fb16e34 100644 --- a/src/common/expressionmatch.cpp +++ b/src/common/expressionmatch.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2019 by the Quassel Project * + * Copyright (C) 2005-2022 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()) {