Electronic Serial Number (ESN) Regular Expression

Category: Strings

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:

Expression Flags

Flags Description
i Ignore case sensitive.
g Allows global search.
m Allows multiline search.