Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
(\+41|0041|0){1}(\(0\))?[0-9]{2}[\s.-]?[0-9]{3}[\s.-]?[0-9]{2}[\s.-]?[0-9]{2}$
/
gm

Description

Regular Expression

(+41|0041|0){1}((0))?[0-9]{2}[\s.-]?[0-9]{3}[\s.-]?[0-9]{2}[\s.-]?[0-9]{2}$

Test String True 0782342323 0041782342323 +41782342323

078.234.23.23 004178.234.23.23 +4178.234.23.23

078-234-23-23 004178-234-23-23 +4178-234-23-23

078 234 23 23 004178 234 23 23 +4178 234 23 23

Submitted by anonymous - 6 years ago