Title |
Test
Find
U,S. Phone Number Parser for .NET (with named groups)
|
Expression |
(\+1|1)?[ \-\.]?\(?(?<areacode>[0-9]{3})\)?[ \-\.]?(?<prefix>[0-9]{3})[ \-\.]?(?<number>[0-9]{4})[ \.]*(ext|x)?[ \.]*(?<extension>[0-9]{0,5}) |
Description |
This regular expression parses virtually any variety of U.S. phone numbers--with or without an extension. If you want a version without the named groups, you can use: (\+1|1)?[ \-\.]?\(?[0-9]{3}\)?[ \-\.]?[0-9]{3}[ \-\.]?[0-9]{4}[ \.]*(ext|x)?[ \.]*[0-9]{0,5} |
Matches |
601-555-1212|601 5551212|+1.6015551212|601 555 1212|601.555.1212x232|601.555.1212ext232|1 601.555.1212ext232|+1 601.555.1212ext232|+1.(601)5551212|(601) 555 1212|601.555.1212x232|601.555.1212 x233|601.555.1212 x 234|601.555.1212 ext 234|601.555.1212 ext. 234 |
Non-Matches |
601+555+1212 |
Author |
Rating:
Not yet rated.
Anthony Gatlin
|
Source |
Anthony Gatlin |
Your Rating |
|