mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
refs #710 Simple algorithms to replace several regular expressions.
This commit is contained in:
@@ -31,9 +31,8 @@ namespace BlackMisc
|
||||
{
|
||||
QString code = icaoCode.trimmed().toUpper();
|
||||
if (code.length() != 4) return "";
|
||||
QRegularExpression reg("^[A-Z0-9]{4}$");
|
||||
auto match = reg.match(code);
|
||||
return match.hasMatch() ? code : QString();
|
||||
if (containsChar(code, [](QChar c) { return !c.isLetterOrNumber(); })) { return ""; }
|
||||
return code;
|
||||
}
|
||||
|
||||
bool CAirportIcaoCode::isValidIcaoDesignator(const QString &icaoCode)
|
||||
|
||||
Reference in New Issue
Block a user