diff options
author | yuzubot <yuzu@yuzu-emu.org> | 2022-11-21 13:03:21 +0000 |
---|---|---|
committer | yuzubot <yuzu@yuzu-emu.org> | 2022-11-21 13:03:21 +0000 |
commit | 5ad585b0f8a89d9689aedb2bf0dd1aa2e31eb9d0 (patch) | |
tree | 440d637c8bfb6c9141953730e0e5456d9b4cd525 /src/yuzu/multiplayer/validation.h | |
parent | ecb405b389eb922a0aa30a62deb3e422a21e24bf (diff) |
"Merge Tagged PR 8829"mainline-0-1245
Diffstat (limited to 'src/yuzu/multiplayer/validation.h')
-rw-r--r-- | src/yuzu/multiplayer/validation.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/yuzu/multiplayer/validation.h b/src/yuzu/multiplayer/validation.h index dabf860bef..dd25af2802 100644 --- a/src/yuzu/multiplayer/validation.h +++ b/src/yuzu/multiplayer/validation.h @@ -3,7 +3,7 @@ #pragma once -#include <QRegExp> +#include <QRegularExpression> #include <QString> #include <QValidator> @@ -29,19 +29,21 @@ public: private: /// room name can be alphanumeric and " " "_" "." and "-" and must have a size of 4-20 - QRegExp room_name_regex = QRegExp(QStringLiteral("^[a-zA-Z0-9._- ]{4,20}$")); - QRegExpValidator room_name; + QRegularExpression room_name_regex = + QRegularExpression(QStringLiteral("^[a-zA-Z0-9._ -]{4,20}")); + QRegularExpressionValidator room_name; /// nickname can be alphanumeric and " " "_" "." and "-" and must have a size of 4-20 - QRegExp nickname_regex = QRegExp(QStringLiteral("^[a-zA-Z0-9._- ]{4,20}$")); - QRegExpValidator nickname; + const QRegularExpression nickname_regex = + QRegularExpression(QStringLiteral("^[a-zA-Z0-9._ -]{4,20}")); + QRegularExpressionValidator nickname; /// ipv4 address only // TODO remove this when we support hostnames in direct connect - QRegExp ip_regex = QRegExp(QStringLiteral( + QRegularExpression ip_regex = QRegularExpression(QStringLiteral( "(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|" "2[0-4][0-9]|25[0-5])")); - QRegExpValidator ip; + QRegularExpressionValidator ip; /// port must be between 0 and 65535 QIntValidator port; |