Regular Expressions 101

Sponsors

Library entries

1
javascript

Match HMTL/WXML tag and class

Match HMTL/WXML tag and class
Submitted by ice breaker - 7 days ago
2
python

lottery data picker

for azlottoapi
Submitted by anonymous - a year ago
2
python

IpAddress

Ensure the ip address format is correct
Submitted by aaa - a year ago
2
javascript

Simple URL

Validate an URL input.
Submitted by @nuragic - 4 months ago
2
python

Extract parts of a URL on Python

Extract parts of a URL on Python
Submitted by dixanms - 4 months ago
2
python

Lua Enhanced: +=

Adds += to Lua.
Submitted by anonymous - 3 months ago
2
javascript

Error in Refex

no description available
Submitted by anonymous - 9 years ago

North American Phone Number

Vote

4

Regular Expression
javascript

/
(?=(?:^(?:\+?1\s*(?:[.-]\s*)?)?(?!(?:(?:.*\(.*)|(?:.*\).*)))(?:[2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))|(?:.*\((?:[2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\).*))(?:\+?1\s*(?:[.-]\s*)?)?(?:\(?([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\)?)\s*(?:[.-]\s*)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d{1,15}))?$
/
gm

Description

Loading markdown...
Submitted by AaronBoots - 5 years ago