Social Insurance Number (SIN Canada) Regular Expression

A regular expression that validates and matches Social Insurance Number (SIN Canada).

/^(\d{3}-\d{3}-\d{3})|(\d{9})$/

Matches:

  • 123-456-789
  • 123456789

Non-matches:

  • 123 456 789
  • 1234-567-89
  • 123-4567-89

See Also: