diff --git a/Telegram/SourceFiles/dialogs/dialogs_search_posts.cpp b/Telegram/SourceFiles/dialogs/dialogs_search_posts.cpp index 011c252b10..f6ea385258 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_search_posts.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_search_posts.cpp @@ -20,6 +20,12 @@ namespace { constexpr auto kQueryDelay = crl::time(500); constexpr auto kPerPage = 50; +[[nodiscard]] const QRegularExpression &SearchSplitter() { + static const auto result = QRegularExpression(QString::fromLatin1("" + "[\\@\\s\\-\\+\\(\\)\\[\\]\\{\\}\\<\\>\\,\\.\\!\\_\\;\\\"\\'\\x0]")); + return result; +} + } // namespace PostsSearch::PostsSearch(not_null session) @@ -58,7 +64,9 @@ void PostsSearch::requestMore() { } void PostsSearch::setQuery(const QString &query) { - const auto words = TextUtilities::PrepareSearchWords(query); + const auto words = TextUtilities::PrepareSearchWords( + query, + &SearchSplitter()); const auto prepared = words.isEmpty() ? QString() : words.join(' '); if (_queryExact == query) { return;