Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^(0[1-9]|2[AB]|[1-8][0-9]|9[0-59]|97[1-8]|98[4-9])(\ *\,\ *(0[1-9]|2[AB]|[1-8][0-9]|9[0-59]|97[1-8]|98[4-9]))*$
/
i

Description

Allows to check a comma separated list of french "departement" codes. Stands metropolitan and extra territorial codes such as Martinique, Polynésie, Mayotte, etc.

Submitted by anonymous - 5 years ago