common: Make regular expressions Unicode-aware
authorShane Synan <digitalcircuit36939@gmail.com>
Tue, 8 Jun 2021 03:06:13 +0000 (23:06 -0400)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 20 Jun 2021 12:21:28 +0000 (14:21 +0200)
commit02a188baf63969b6e6f14c49d305c79b61a2cb06
tree46fc481eed785db64fd72a0b1f64d98518a649fe
parent614f5948115e94994686e2542df3863ab3b1af2c
common: Make regular expressions Unicode-aware

Without the UseUnicodePropertiesOption flag, Qt's regular expressions do
not include extra-ASCII codepoints when matching character classes. This
results in \W (used by the highlight logic to prevent matching against
substrings) matching against letters with diacritics, meaning the words
'Västra' and 'TÜV' would both count as a highlight for the nick V.

Add unit tests to verify this functionality is correct in Quassel and
any projects that implement ExpressionMatch.

Co-authored-by: V <v@anomalous.eu>
src/common/expressionmatch.cpp
tests/common/expressionmatchtest.cpp