RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 14
Title Test Details Phone Numbers
Expression
^(1\s*[-\/\.]?)?(\((\d{3})\)|(\d{3}))\s*[-\/\.]?\s*(\d{3})\s*[-\/\.]?\s*(\d{4})\s*(([xX]|[eE][xX][tT])\.?\s*(\d+))*$
Description
This regular expressions matches phone numbers with area codes and optional US country code and optional phone extension. User have so many ways of entering phone numbers into input fields. This allows for some of the ones I've encountered. Feel free to contact me if you find ones that do not match.
Matches
2405525009 | 1(240) 652-5009 | 240/752-5009 ext.55
Non-Matches
(2405525009 | 2 (240) 652-5009
Author Rating: The rating for this expression. Dean Dal Bozzo
Title Test Details Resale License Number (CA)
Expression
^((([sS][r-tR-Tx-zX-Z])\s*([sx-zSX-Z])?\s*([a-zA-Z]{2,3}))?\s*(\d\d)\s*-?\s*(\d{6,7}))$
Description
California Resale License number validator. Validates Letters and Numbers or Number only. Letters: First 2 letters can be SR, SS, ST , SX, SY, SZ (TAT Code) Next optional letter can be S,X,Y,Z. Next letters must be a minimum of two and a maximum of 3 (District Code). Numbers: Can be 8-9 numbers. Numbers can be delimited with a hypen or spaces after the first 2 numbers. Note: I use () to extract the information I want for use in other scripts.
Matches
SR BH 97-578613 | 97578613 | SRXBH97578613
Non-Matches
RR BH 97-578613 | 9757861 | SRAABH 97-578613
Author Rating: Not yet rated. Dean Dal Bozzo
Title Test Details Web Colors (216)
Expression
^#?(([fFcC0369])\2){3}$
Description
Matches the 216 web colors with or without the '#' sign.
Matches
#FFFFFF | FFCC00 | 003300
Non-Matches
#FFFFF | EFCC00 | 030303
Author Rating: Not yet rated. Dean Dal Bozzo
Title Test Details IPv6 address
Expression
^([0-9a-fA-F]{4}|0)(\:([0-9a-fA-F]{4}|0)){7}$
Description
IPv6 address (128 bit). Matches hexadecimal patterns and single 0 in the address.
Matches
3e4f:123f:c12a:5566:888e:9975:aaff:2344 | 3e4f:123f:c12a:0:0:0:0:2344 | 0000:0000:0000:0000:0000:000
Non-Matches
3e4f:123f:c12a:5566:888e:9975:aafg:2344 | 3e4f:123f:c12a:0:0:0:1:2344 | 0000:0000:0000:0000:0000:000
Author Rating: Not yet rated. Dean Dal Bozzo
Title Test Details Port Numbers
Expression
^(102[0-3]|10[0-1]\d|[1-9][0-9]{0,2}|0)$
Description
Port Numbers: Well Known Ports: 0 through 1023. Matches numbers in range of 0 through 1023.
Matches
0 | 123 | 1023
Non-Matches
1024 | 9999 | 99999
Author Rating: Not yet rated. Dean Dal Bozzo
Title Test Details Port Numbers
Expression
^(4915[0-1]|491[0-4]\d|490\d\d|4[0-8]\d{3}|[1-3]\d{4}|[2-9]\d{3}|1[1-9]\d{2}|10[3-9]\d|102[4-9])$
Description
Port Numbers: Registered Ports: 1024 through 49151. Matches numbers in range of 1024 through 49151.
Matches
1024 | 49151 | 30100
Non-Matches
1023 | 49152 | 50000
Author Rating: Not yet rated. Dean Dal Bozzo
Title Test Details Port Numbers
Expression
^(6553[0-5]|655[0-2]\d|65[0-4]\d\d|6[0-4]\d{3}|5\d{4}|49[2-9]\d\d|491[6-9]\d|4915[2-9])$
Description
Port Numbers: Dynamic and/or Private Ports: 49152 through 65535. Matches numbers in range of 49152 through 65535.
Matches
49152 | 65535 | 50000
Non-Matches
49151 | 65536 | 66000
Author Rating: The rating for this expression. Dean Dal Bozzo
Title Test Details Port Numbers
Expression
^(4915[0-1]|491[0-4]\d|490\d\d|4[0-8]\d{3}|[1-3]\d{4}|[1-9]\d{0,3}|0)$
Description
Port Numbers: Well Known Ports & Registered Ports: 0 through 49151. Matches numbers in range of 0 through 49151.
Matches
0 | 1023 | 49151
Non-Matches
49152 | 50000 | 60000
Author Rating: The rating for this expression. Dean Dal Bozzo
Title Test Details Port Numbers
Expression
^(6553[0-5]|655[0-2]\d|65[0-4]\d\d|6[0-4]\d{3}|[1-5]\d{4}|[1-9]\d{0,3}|0)$
Description
Port Numbers: Well Known Ports, Registered Ports & Dynamic and/or Private Ports: 0 through 65536. Matches numbers in range of 0 through 65536.
Matches
1023 | 49151 | 65535
Non-Matches
65536 | 66000 | 67000
Author Rating: The rating for this expression. Dean Dal Bozzo
Title Test Details URL
Expression
^((([hH][tT][tT][pP][sS]?|[fF][tT][pP])\:\/\/)?([\w\.\-]+(\:[\w\.\&%\$\-]+)*@)?((([^\s\(\)\<\>\\\"\.\[\]\,@;:]+)(\.[^\s\(\)\<\>\\\"\.\[\]\,@;:]+)*(\.[a-zA-Z]{2,4}))|((([01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}([01]?\d{1,2}|2[0-4]\d|25[0-5])))(\b\:(6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|[1-5]\d{4}|[1-9]\d{0,3}|0)\b)?((\/[^\/][\w\.\,\?\'\\\/\+&%\$#\=~_\-@]*)*[^\.\,\?\"\'\(\)\[\]!;<>{}\s\x7F-\xFF])?)$
Description
Matches a URL string by: protocol,subdomain,domain,ip address,port number,path and/or filename
Matches
http://regexlib.com | https://regexlib.com:80 | 66.129.120.94/Search.aspx
Non-Matches
http:/regexlib.com | https://regexlib.com:65536 | 66.129.120.256/Search.aspx.
Author Rating: Not yet rated. Dean Dal Bozzo
Title Test Details Time
Expression
^((0?[1-9]|1[012])(\s*:\s*([0-5]\d))?(\s*:\s*([0-5]\d))?(\s*([AaPp])[Mm]?)$|(2[0-3]|[1]\d|0?\d)(\s*:\s*([0-5]\d))(\s*:\s*([0-5]\d))?)$
Description
Matches a time string. A loose validation for easy user entry. Saves the information needed for a correct time setting.
Matches
3:00:59 | 12pm | 6:30 a
Non-Matches
12 | 25pm | 6:60 a
Author Rating: Not yet rated. Dean Dal Bozzo
Title Test Details DOCTYPE
Expression
\<\!doctype\s+(([^\s\>]+)\s+)?(([^\s\>]+)\s*)?(\"([^\/]+)\/\/([^\/]+)\/\/([^\s]+)\s([^\/]+)\/\/([^\"]+)\")?(\s*\"([^\"]+)\")?\>
Description
Check and parse a DOCTYPE tag elements: (topElement, availability, registration, organization, type, label, language, url)
Matches
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> | <!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd">
Non-Matches
<DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> | <HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> | DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd"
Author Rating: Not yet rated. Dean Dal Bozzo
   Displaying page 1 of 1 pages; Items 1 to 14

Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials