US Social Security Number validation

Q

How to perform a validation on US Social Security Numbers using a regular expression? For example, "333-23-2329" is a valid US Social Security Number.

✍: Guest

A

To perform a basic validation on US Social Security Numbers, try this regular expression:

^[\d]{3}-[\d]{2}-[\d]{4}$

Click the button to test this regular expression here online:

2013-01-27, 2194👍, 0💬