feat: add format validation to all AE Title input editor

This commit is contained in:
kradchen
2025-09-04 09:36:58 +08:00
parent 9326651c52
commit b35312c1b5
6 changed files with 43 additions and 2 deletions

View File

@@ -2,7 +2,13 @@
#include <QRegularExpression>
bool InputFormatValidator::ValidateIpAddressFormat(const QString& aIpAddress)
bool InputFormatValidator::ValidateAETitleFormat(const QString &aAeTitle)
{
QRegularExpression regex("^[0-9a-zA-Z_-]{1,16}$");
return regex.match(aAeTitle).hasMatch();
}
bool InputFormatValidator::ValidateIpAddressFormat(const QString &aIpAddress)
{
QRegularExpression regex("^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$");
return regex.match(aIpAddress).hasMatch();