following regular expression accepts phone number in any form that user can supply it:
yyyyyyyyy
yyy yyyyyy
yyy yyy yyy
xxxyyyyyyyyy
xxx yyyyyyyyy
xxx yyy yyyyyy
xxx yyy yyy yyy
+xxxyyyyyyyyy
+xxx yyyyyyyyy
+xxx yyy yyyyyy
+xxx yyy yyy yyy
so here is regular expression:
^[+]{0,1}[0-9]{0,3}[ ]{0,1}[0-9]{3,3}[ ]{0,1}[0-9]{3,3}[ ]{0,1}[0-9]{3,3}$
works in PHP, Javasrcipt and i suppose anywhere else
Žádné komentáře:
Okomentovat