feat: add format validation to all AE Title input editor
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user