Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2017-03-10 18:42
Flavor·JavaScript

/
^(\d{10,21})|(\+\d{1,3}|\d{1,4}|\(\+\d{1,3}\)|\(\d{1,2}\))(([ -.]\d+){1,5}$|([ -.]\d+){1,5}([ -.](ext\.|x|extention))[ -.]\d{1,5}$)
/
gm
Open regex in editor

Description

I don't know how many times I found some regex online that just didn't work. Finally decided to write my own that actually works for some of our customers around the world.

Submitted by Alexei Yagolnikov