Regular Expressions 101

Community Patterns

US Social Security Number

2

Regular Expression
PCRE2 (PHP >=7.3)

/
(?:\d[ -]*?){9}
/
gm

Description

Finds a number that is 9 digits long. Can have spaces or hyphens in between the numbers and will still be found

Submitted by anonymous - 2 years ago