c# - Phone Number Regex -


i need regular expression phone number includes country code, area code , phone number.the phone number format should like: 001-253-3478887 or 90-312-4900203. try not work. should correct format? how can phone number info?

(\(\d{3}-))?\d{3}-\d{4} 

^((\d-\d{3})|(\d{1,3}))\-\d{3}-\d{7}$ 

this regex match country codes. country codes of 1 , 1-684 won't valid in other answers. prevent country codes such 1-42 being allowed, since time there should separator in country code when it's 4 digits long. if end getting 4 digit country codes without separator, use following instead:

^((\d{4})|(\d{1,3}))\-\d{3}-\d{7}$ 

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -