Electronic Serial Number (ESN) Regular Expression

A regular expression to match and validate Electronic Serial Number used in mobile devices.

/^([0-9a-fA-F]){8}$/

Matches:

  • 89aaff99
  • 12345678
  • 34567abc

Non-matches:

  • 89aaff99a
  • 1234567
  • 34567abcd

See Also: