Regular Expressions 101

Community Patterns

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 - 2 months ago