bool VerifyPhoneNo(const char *sTelNo_)
{
bool bRet = true;
char *sTelNo=NULL;
sTelNo = replaceAll2(sTelNo_, "- ", "");
if (0 == strncmp(sTelNo, "011", 3) || 0 == strncmp(sTelNo, "016", 3) ||
0 == strncmp(sTelNo, "017", 3) || 0 == strncmp(sTelNo, "018", 3) ||
0 == strncmp(sTelNo, "019", 3) || 0 == strncmp(sTelNo, "010", 3) )
{
if (10 > strlen(sTelNo) || 11 < strlen(sTelNo)) {
bRet = false;
goto jump_here;
}
} else {
if (!isdigit(sTelNo[0]) || 10 > strlen(sTelNo) || 11 < strlen(sTelNo)) {
bRet = false;
goto jump_here;
}
}
jump_here:
if (sTelNo)
free(sTelNo);
return bRet;
}