Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
^([a-zA-Z]{2,3})(([\-\_][a-zA-Z]{4})+)?([\-\_][a-zA-Z]{2})?([\-\_][a-zA-Z]*)?(@(collation|calendar|currency|numbers)\=[a-zA-Z]*[;]?((collation|calendar|currency|numbers)\=[a-zA-Z\-\_]*[;]?)*)?
/
gm

Description

Regexp to match against a icu locale string

Submitted by Sylvain Combes - 7 years ago