Regular Expressions 101

US Social Security Number

Open Workspace
  • PCRE2 (PHP)
  • Match
2

Regular Expression

/
(?:\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