Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^[^-_]+[-_]+[a-zA-Z]+$
/
gmi

Description

begins with letters , then a dash or underscore and ends with letters Perfect for Language Culture Names like 'fr-FR' (or 'fr_FR')

Submitted by EO-TeSdY - 9 years ago