Regular Expressions 101

Library entries

US phone number

Vote

2

Regular Expression
pcre2

/
(\+?(\b1)?[\ .\/-]?((?(2)|(\b))|(\())\d{3}(?(?<=\(\d{3})\)|)[\ .\/-]?)?(?(1)|\b)\d{3}[\ .\/-]?\d{4}[\ ]?([xX][\ ]?\d{1,5})?\b
/
gm

Description

Loading markdown...
Submitted by anonymous - 3 months ago