.net - Regex for american phone numbers that will also pickup (123) space and 123 dot -


possible duplicate:
a comprehensive regex phone number validation

i've got this.

1?\s*-?\s*(\d{3}|\(\s*\d{3}\s*\))\s*-?\s*\d{3}\s*-?\s*\d{4} 

it matching lot of phone numbers, it's not catching these two:

(123) 456-7890 or 123.456.7890

awhile asked question a regex number of digits in string. answer gave me regex (\d*\d){10}{n}.

i've used phone number validation since then. not care format give me phone number in, long contains 10 digits. if care area code + phone number, may work well.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -