Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
(?:(\+)?(1)?([-(.])?([1-9]\d{2})([-).])?\s?([1-9]\d{2})([-.])?(\d{4})|([1-9]\d{2})([-.])?([1-9]\d{2})([-.])?(\d{4})|([1-9]\d{2})([-.])?(\d{4}))
/
gm

Description

Enhanced US Phone Number to reduce false positives.

Submitted by anonymous - 5 years ago