From bc908a1038ddcc259bbb50c0c0957ab0ff9d5a39 Mon Sep 17 00:00:00 2001 From: Albert S Date: Tue, 14 Jun 2022 10:15:00 +0200 Subject: [PATCH] shared: LooqsQuery: Add unicode category class for numbers to regex --- shared/looqsquery.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/looqsquery.cpp b/shared/looqsquery.cpp index 3789054..4eb7cec 100644 --- a/shared/looqsquery.cpp +++ b/shared/looqsquery.cpp @@ -181,8 +181,8 @@ LooqsQuery LooqsQuery::build(QString expression, TokenType loneWordsTokenType, b QStringList loneWords; LooqsQuery result; QRegularExpression rx( - "((?(\\.|\\w)+):(?\\((?[^\\)]+)\\)|([\\p{L},])+)|(?AND|OR)" - "|(?!)|(?\\(|\\))|(?[\"\\p{L}]+))"); + "((?(\\.|\\w)+):(?\\((?[^\\)]+)\\)|([\\p{L}\\p{N},])+)|(?AND|OR)" + "|(?!)|(?\\(|\\))|(?[\"\\p{L}\\p{N}]+))"); QRegularExpressionMatchIterator i = rx.globalMatch(expression); auto previousWasBool = [&result] { return !result.tokens.empty() && ((result.tokens.last().type & BOOL) == BOOL); }; auto previousWas = [&result](TokenType t) { return !result.tokens.empty() && (result.tokens.last().type == t); };