{
//Pattern to compare all characters except 0-9 * # P ; , +
String phoneNumberPattern(L"[^0-9*#P,p+;]");
- String phoneNumberEndingWithHash(L"#$");
- RegularExpression checkPhoneNumber,checkHash;
+ RegularExpression checkPhoneNumber;
checkPhoneNumber.Construct(phoneNumberPattern);
- checkHash.Construct(phoneNumberEndingWithHash);
//If there is any character other than these listed above then display invalid number
bool resultMatch = checkPhoneNumber.Match(phoneNumber,false);
//return false for patterns other than 0-9 * # P ; , +
- bool endsWithHash = checkHash.Match(phoneNumber,false);
- //returns false for any numbers that end with Hash
- if(resultMatch == true || endsWithHash == true)
+ if(resultMatch == true)
{
//return phone number is invalid
return false;