Regular Expressions 101

Sponsors

Library entries

0
javascript

bank account number

no description available
Submitted by anonymous - 5 years ago
0
javascript

duplicate words

no description available
Submitted by anonymous - 5 years ago
0
javascript

vmnames

no description available
Submitted by anonymous - 5 years ago
0
javascript

symbols and numbers

no description available
Submitted by anonymous - 5 years ago
0
javascript

regex 5000000 - 8999999

no description available
Submitted by anonymous - 5 years ago
0
javascript

regex for android consumer site

no description available
Submitted by anonymous - 5 years ago
0
javascript

only numbers csv

regex to match an only numbers csv
Submitted by anonymous - 5 years ago
0
javascript

NFS share

matches a NFS share valid URL.
Submitted by anonymous - 5 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 - 6 years ago