Validate phone number ios

前端 未结 9 1791
温柔的废话
温柔的废话 2020-12-10 00:42

I need to validate an international phone number.

I know its difficult to validate an international phone number, so I\'m going to keep it simple:

+

9条回答
  •  旧时难觅i
    2020-12-10 01:20

    NSString *phoneRegex = @"^((\\+)|(00))[0-9]{6,14}$";
    

    This way is bit better. Your code will work as well if you escape the "\".

提交回复
热议问题