Regular Expressions 101

Library entries

phone regex

Vote

2

Regular Expression
javascript

/
(?=.*?\d{3}( |-|.)?\d{4})((?:\+?(?:1)(?:\1|\s*?))?(?:(?:\d{3}\s*?)|(?:\((?:\d{3})\)\s*?))\1?(?:\d{3})\1?(?:\d{4})(?:\s*?(?:#|(?:ext\.?))(?:\d{1,5}))?)\b
/
gi

Description

Loading markdown...
Submitted by Mélissa Dumont - 7 years ago