Regular Expressions 101

Sponsors

Library entries

6
javascript

HTML img

Grabs all HTML tags
Submitted by Pirate11 - 7 years ago
6
javascript

Email

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

Hello world !

no description available
Submitted by Fedir RYKHTIK - 9 years ago
5
javascript

Accept url without www

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

MAC address

a mac address separated by dashes or colons.
Submitted by anonymous - 7 years ago
5
javascript

password 1upper 1lower 1number 1specialcharater

fjk@1Qaa$
Submitted by Anuswadh - 6 years ago
4
javascript

Repeated words (JS)

no description available
Submitted by paconaranjo - 8 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