mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-24 09:54:16 +08:00
refs #288, improved validation in some value objects
This commit is contained in:
committed by
Roland Winklmeier
parent
5ff28cb3a1
commit
d1d02d6c3c
@@ -126,5 +126,15 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Valid callsign?
|
||||
*/
|
||||
bool CCallsign::isValidCallsign(const QString &callsign)
|
||||
{
|
||||
static QRegularExpression regexp("^[A-Z]+[A-Z0-9]*$");
|
||||
if (callsign.length() < 2 || callsign.length() > 10) return false;
|
||||
return (regexp.match(callsign).hasMatch());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user