From 3fea35ff19b52da94fa3ed17695f00b79bfb1917 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Thu, 29 Dec 2022 12:37:58 +0300 Subject: [PATCH] Added regexp for excluding digits. --- ui/text/text_entity.cpp | 4 ++++ ui/text/text_entity.h | 1 + 2 files changed, 5 insertions(+) diff --git a/ui/text/text_entity.cpp b/ui/text/text_entity.cpp index fdb5c09..4844392 100644 --- a/ui/text/text_entity.cpp +++ b/ui/text/text_entity.cpp @@ -1236,6 +1236,10 @@ const QRegularExpression &RegExpBotCommand() { return result; } +QRegularExpression RegExpDigitsExclude() { + return QRegularExpression("[^\\d]"); +} + QString MarkdownBoldGoodBefore() { return SeparatorsBold(); } diff --git a/ui/text/text_entity.h b/ui/text/text_entity.h index d5a770c..3756539 100644 --- a/ui/text/text_entity.h +++ b/ui/text/text_entity.h @@ -288,6 +288,7 @@ const QRegularExpression &RegExpHashtag(); const QRegularExpression &RegExpHashtagExclude(); const QRegularExpression &RegExpMention(); const QRegularExpression &RegExpBotCommand(); +QRegularExpression RegExpDigitsExclude(); QString MarkdownBoldGoodBefore(); QString MarkdownBoldBadAfter(); QString MarkdownItalicGoodBefore();