Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^[A-HJ-NPR-Z\d]{8}[\dX][A-HJ-NPR-Z\d]{8}$
/
gm

Description

Rules:

  • MUST have 17 alphanumeric letters except I, O, and Q to avoid confusion
  • Position 9 is the check digit 0-9 and X (10)
Submitted by anonymous - 5 years ago