Skip to content

Instantly share code, notes, and snippets.

@wiltonbsilva
Created June 14, 2014 12:26
Show Gist options
  • Save wiltonbsilva/cff6ed2970d11e8f8934 to your computer and use it in GitHub Desktop.
Save wiltonbsilva/cff6ed2970d11e8f8934 to your computer and use it in GitHub Desktop.
Regular Expression to match a Brazilian CPF (similar to an SSN)
RegEx:
^([-\.\s]?(\d{3})){3}[-\.\s]?(\d{2})$
Test:
345.753.428-40
Test:
345.753.422.99
Test:
123-543-667.54
Test:
123 456 789 01
Test:
34575342840
@readpan
Copy link

readpan commented Oct 21, 2022

Thranks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment