Regular Expressions 101

Community Library Entry

-1

Regular Expression
ECMAScript (JavaScript)

/
^\+?[1]?[2-9]{1}11$
/
gm

Description

This expression can be used for identifying if a string (such as a dialed number using a cloud based telephony service) matches one of the known North American US N11 Service Numbers. It will match if the number is in e.164 format or not, and only matches when the string begins and ends with the desired values.

Submitted by Benjamin Dean - 8 years ago