refs #288, improved validation in some value objects

This commit is contained in:
Klaus Basan
2014-11-15 01:20:31 +01:00
committed by Roland Winklmeier
parent 5ff28cb3a1
commit d1d02d6c3c
8 changed files with 85 additions and 7 deletions

View File

@@ -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