diff --git a/Telegram/SourceFiles/intro/intro_code.cpp b/Telegram/SourceFiles/intro/intro_code.cpp index 1f2fff51b4..15d25b1b80 100644 --- a/Telegram/SourceFiles/intro/intro_code.cpp +++ b/Telegram/SourceFiles/intro/intro_code.cpp @@ -391,7 +391,7 @@ void CodeWidget::submitCode() { const auto text = QString( _code->getLastText() ).remove( - QRegularExpression("[^\\d]") + TextUtilities::RegExpDigitsExclude() ).mid(0, getData()->codeLength); if (_sentRequest diff --git a/Telegram/SourceFiles/passport/passport_panel_controller.cpp b/Telegram/SourceFiles/passport/passport_panel_controller.cpp index e180834f3b..ddfd24ce42 100644 --- a/Telegram/SourceFiles/passport/passport_panel_controller.cpp +++ b/Telegram/SourceFiles/passport/passport_panel_controller.cpp @@ -487,7 +487,9 @@ EditContactScheme GetContactScheme(Scope::Type type) { return Ui::FormatPhone(value); }; result.postprocess = [](QString value) { - return value.replace(QRegularExpression("[^\\d]"), QString()); + return value.replace( + TextUtilities::RegExpDigitsExclude(), + QString()); }; return result; } break; diff --git a/Telegram/SourceFiles/ui/text/format_values.cpp b/Telegram/SourceFiles/ui/text/format_values.cpp index 36b3914885..818e3e40fc 100644 --- a/Telegram/SourceFiles/ui/text/format_values.cpp +++ b/Telegram/SourceFiles/ui/text/format_values.cpp @@ -10,7 +10,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "lang/lang_keys.h" #include "countries/countries_instance.h" -#include #include #include #include diff --git a/Telegram/SourceFiles/ui/widgets/fields/special_fields.cpp b/Telegram/SourceFiles/ui/widgets/fields/special_fields.cpp index 488c3bf2be..245d8cddbe 100644 --- a/Telegram/SourceFiles/ui/widgets/fields/special_fields.cpp +++ b/Telegram/SourceFiles/ui/widgets/fields/special_fields.cpp @@ -136,7 +136,7 @@ void PhonePartInput::correctValue( int &nowCursor) { if (!now.isEmpty() && (_lastDigits != now)) { _lastDigits = now; - _lastDigits.replace(QRegularExpression("[^\\d]"), QString()); + _lastDigits.replace(TextUtilities::RegExpDigitsExclude(), QString()); updatePattern(_groupsCallback(_code + _lastDigits)); } @@ -359,7 +359,7 @@ void PhoneInput::correctValue( QString &now, int &nowCursor) { auto digits = now; - digits.replace(QRegularExpression("[^\\d]"), QString()); + digits.replace(TextUtilities::RegExpDigitsExclude(), QString()); _pattern = _groupsCallback(digits); QString newPlaceholder; diff --git a/Telegram/SourceFiles/ui/widgets/sent_code_field.cpp b/Telegram/SourceFiles/ui/widgets/sent_code_field.cpp index e3a76f16e2..b98d324660 100644 --- a/Telegram/SourceFiles/ui/widgets/sent_code_field.cpp +++ b/Telegram/SourceFiles/ui/widgets/sent_code_field.cpp @@ -34,9 +34,7 @@ void SentCodeField::setChangedCallback(Fn changedCallback) { QString SentCodeField::getDigitsOnly() const { return QString( getLastText() - ).remove( - QRegularExpression("[^\\d]") - ); + ).remove(TextUtilities::RegExpDigitsExclude()); } void SentCodeField::fix() { diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 28fd4eea95..3fea35ff19 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 28fd4eea95f4012f1b864d385259ee2de2284ff9 +Subproject commit 3fea35ff19b52da94fa3ed17695f00b79bfb1917