UK Bank Sort Code Regular Expression

A regular expression to match a UK Bank Sort Codes, which consists of a six-digit number formatted as 12-34-56.

/^[0-9]{2}[-][0-9]{2}[-][0-9]{2}$/

Matches

  • 12-23-43

Non-matches:

  • 12-2345
  • 12-23-456
  • 123456

See Also:

Regex Is Copied!