Regular Expressions 101

Community Patterns

Community Library Entry

3

Regular Expression
PCRE (PHP <7.3)

/
^(?:0|\+33 ?|0?0?33 ?|)([1-9] ?(?:[0-9] ?){8})$
/
i

Description

Matches french numbers (not special numbers like 115, 18). First matching group contains the right part without prefix (0, +33, 33, 033, or 0033).

Submitted by xdrm-brackets - 8 years ago