I needed a regular expression to handle phone numbers in a variety of formats. Came up with the following:
([(]?\d{3}[)]?(- .)?\d{3}(- .)?\d{4})
It works with just about any U.S. number you can throw at it.
(800) 555-1212
800.555.1212
800-555-1212
8005551212
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment