Regular Expressions 101

Community Patterns

Community Library Entry

-1

Regular Expression
PCRE (PHP <7.3)

/
(\+?\d{1,4}?[-.\s]?)?(\(\d{1,4}?\))?[-.\s]?\d{1,4}[-.\s]?\d{1,4}[-.\s]?\d{1,9}
/

Description

i.e: (555)555-5555 (OK) 5555555555 (ok) 555.555.5555 (ok) 55555555556 (ok) +184 (555)555-5555 (ok) feel free to email me if you can find case that not match at nmquoc89@gmail.com

Submitted by Quoc Kenny Nguyen - 9 years ago