Regular Expressions 101

Community Patterns

1...45678...902

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
^(?:[A-Z]{2}-?[A-Z]{2}-?\d{2}|[A-Z]{2}-?\d{2}-?\d{2})$
/
gm

Description

AB-CD-12 AB-12-34 ABCD12 AB1234

Submitted by Pablo - 3 months ago