开发者

Telephone number format should be international,Is there any Regex for phone number validation in iPhone

Telephone number should be international and user has to enter the complete phone number with country code.

For that I n开发者_JAVA百科eed a regex for formatting the phone number.


For real regex testing use RegexKitLite.

As for the regular expression itself, something like this (from Validate Phone Numbers: A Detailed Guide) should work:

^\+(?:[0-9] ?){6,14}[0-9]$

Note that when you specify it in your code you need to escape the backslash character (\), so it would look like this:

NSString *regexString = @"^\\+(?:[0-9] ?){6,14}[0-9]$";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜