Displaying page
of
pages;
Items to
Title |
Test
Details
ZIP+4 - XXXXX-XXXX
|
Expression |
^\d{5}-\d{4}$ |
Description |
Numeric and hyphen 5+4 ZIP code match for ZIP+4. |
Matches |
22222-3333 | 34545-2367 | 56334-2343 |
Non-Matches |
123456789 | A3B 4C5 | 55335 |
Author |
Rating:
Steven Smith
|
Title |
Test
Details
US ZIP (5 or 5+4)
|
Expression |
^\d{5}$|^\d{5}-\d{4}$ |
Description |
This regular expression will match either a 5 digit ZIP code or a ZIP+4 code formatted as 5 digits, a hyphen, and another 4 digits. Other than that, this is just a really really long description of a regular expression that I'm using to test how my front page will look in the case where very long expression descriptions are used. |
Matches |
55555-5555 | 34564-3342 | 90210 |
Non-Matches |
434454444 | 645-32-2345 | abc |
Author |
Rating:
Steven Smith
|
Title |
Test
Details
Email - Overly Simple
|
Expression |
^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$ |
Description |
Simple email expression. Doesn't allow numbers in the domain name and doesn't allow for top level domains that are less than 2 or more than 3 letters (which is fine until they allow more). Doesn't handle multiple "." in the domain ( [email protected]). |
Matches |
|
Non-Matches |
|
Author |
Rating:
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
^\d{5}-\d{4}|\d{5}|[A-Z]\d[A-Z] \d[A-Z]\d$ |
Description |
This expression matches three different formats of postal codes: 5 digit US ZIP code, 5 digit US ZIP code + 4, and 6 digit alphanumeric Canadian Postal Code. The first one must be 5 numeric digits. The ZIP+4 must be 5 numeric digits, a hyphen, and then 4 numeric digits. The Canadian postal code must be of the form ANA NAN where A is any uppercase alphabetic character and N is a numeric digit from 0 to 9. |
Matches |
44240 | 44240-5555 | G3H 6A3 |
Non-Matches |
Ohio | abc | g3h6a3 |
Author |
Rating:
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu|COM|ORG|NET|MIL|EDU)$ |
Description |
Domain names:
This regular expression tests the validity of a domain or hostname. It will match any valid domain name that does not contain characters which are invalid in URLs, and which ends in .com, .org, .net, .mil, or .edu. You can add additional valid TLDs by appending the | (pipe) character and the desired TLD to the list in the parens. |
Matches |
3SquareBand.com | asp.net | army.mil |
Non-Matches |
$SquareBand.com | asp/dot.net | army.military |
Author |
Rating:
Not yet rated.
G. Andrew Duthie
|
Title |
Test
Details
Pattern Title
|
Expression |
^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$ |
Description |
Email validator that adheres directly to the specification for email address naming. It allows for everything from ipaddress and country-code domains, to very rare characters in the username. |
Matches |
|
Non-Matches |
joe | @foo.com | a@a |
Author |
Rating:
Andy Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$ |
Description |
RegExp for validating the format of IP Addresses. This works great with the ASP.NET RegularExpressionValidator server control. |
Matches |
127.0.0.1 | 255.255.255.0 | 192.168.0.1 |
Non-Matches |
1200.5.4.3 | abc.def.ghi.jkl | 255.foo.bar.1 |
Author |
Rating:
G. Andrew Duthie
|
Title |
Test
Details
Pattern Title
|
Expression |
/\*[\d\D]*?\*/ |
Description |
If you need to extract or remove any /* */ sytle comments from any Java, JavaScript, C, C++, CSS, etc code you have this regular expression can help. |
Matches |
/* my comment */ | /* my multiline comment */ | /* my nested comment */ |
Non-Matches |
*/ anything here /* | anything between 2 seperate comments | \* *\ |
Author |
Rating:
Chris Craft
|
Title |
Test
Details
Pattern Title
|
Expression |
\b(([01]?\d?\d|2[0-4]\d|25[0-5])\.){3}([01]?\d?\d|2[0-4]\d|25[0-5])\b |
Description |
Most Concise RegExp for matching Decimal IPs. If nothing else, it'll make your code easier to read. (And I know that \d?\d is \d{1,2} but that's 2 extra characters.)
--Update: darkone noticed 8 characters could be shaved down. I've edited it to reflect this. Thanks, darkone! |
Matches |
217.6.9.89 | 0.0.0.0 | 255.255.255.255 |
Non-Matches |
256.0.0.0 | 0978.3.3.3 | 65.4t.54.3 |
Author |
Rating:
Sean Schricker
|
Title |
Test
Details
Pattern Title
|
Expression |
(AUX|PRN|NUL|COM\d|LPT\d)+\s*$ |
Description |
"Be careful when opening or creating files by using Scripting File System Object. If the filename is based on the user's input, the user might attempt to open a serial port or printer." |
Matches |
COM1 | AUX | LPT1 |
Non-Matches |
image.jpg | index.html | readme.txt |
Author |
Rating:
Not yet rated.
Chris Craft
|
Title |
Test
Details
Pattern Title
|
Expression |
Last.*?(\d+.?\d*) |
Description |
Plucks the last quote of a Stock from the MSN MoneyCentral WebQuote page for any given stock symbol. The URL of the web page where this RegEx should be applied is:
http://localhost/asp/webquote.htm?ipage=qd&Symbol=,give the stock symbol here> You must also use the singleline option. |
Matches |
<TR><TD ALIGN=RIGHT>&nbsp;</TD><TD>Last</TD><TD ALIGN=RIGHT NOW |
Non-Matches |
[AADDSS] |
Author |
Rating:
Not yet rated.
Prasad DV
|
Title |
Test
Details
Pattern Title
|
Expression |
[0-9]{4}\s*[a-zA-Z]{2} |
Description |
Dutch zip code expression
4 numbers - space yes/no - 2 letters
|
Matches |
1054 WD | 1054WD | 1054 wd |
Non-Matches |
10543 |
Author |
Rating:
Not yet rated.
Roland Mensenkamp
|
Title |
Test
Details
Pattern Title
|
Expression |
^\d{5}(-\d{4})?$ |
Description |
Matches standard 5 digit US Zip Codes, or the US ZIP + 4 Standard. |
Matches |
48222 | 48222-1746 |
Non-Matches |
4632 | Blake | 37333-32 |
Author |
Rating:
Blake Facey
|
Title |
Test
Details
Pattern Title
|
Expression |
^[0-9]{4}\s{0,1}[a-zA-Z]{2}$ |
Description |
Regular expression to evaluate dutch zipcodes. This is an updated version of Roland Mensenkamp. |
Matches |
2034AK | 2034 AK | 2034 ak |
Non-Matches |
2034 AK | 321321 AKSSAA |
Author |
Rating:
Not yet rated.
Jon van Leuven
|
Title |
Test
Details
Pattern Title
|
Expression |
^(s-|S-){0,1}[0-9]{3}\s?[0-9]{2}$ |
Description |
Validates swedish zipcodes (postnr) with or without space between groups. With leading s- or not. Can be disconnected by removing ''(s-|S-){0,1}''. |
Matches |
12345 | 932 68 | S-621 46 |
Non-Matches |
5367 | 425611 | 31 545 |
Author |
Rating:
Not yet rated.
Tommy Ullberg
|
Title |
Test
Details
Pattern Title
|
Expression |
^(\d{5}-\d{4}|\d{5})$|^([a-zA-Z]\d[a-zA-Z] \d[a-zA-Z]\d)$ |
Description |
This is a modification of the zip code regular expression submitted by Steven Smith ( [email protected])
It no longer matches 78754-12aA |
Matches |
78754 | 78754-1234 | G3H 6A3 |
Non-Matches |
78754-12aA | 7875A | g3h6a3 |
Author |
Rating:
Khoi Pham
|
Title |
Test
Details
Pattern Title
|
Expression |
^[A-Za-z]{2}[0-9]{6}[A-Za-z]{1}$ |
Description |
UK National Insurance Number validation. Especially useful to validate through clientside/server side script on a website. |
Matches |
SP939393H | PX123456D | SW355667G |
Non-Matches |
12SP9393H | S3P93930D | 11223344SP00ddSS |
Author |
Rating:
Not yet rated.
Santosh Potadar
|
Title |
Test
Details
Pattern Title
|
Expression |
^(0[1-9]|1[0-2])\/((0[1-9]|2\d)|3[0-1])\/(19\d\d|200[0-3])$ |
Description |
This expression is an attempt to match the most obvious features of a valid date in American/US format of the form mm/dd/yyyy for any year 1900 through 2003. It can easily be adapted for different date ranges. It matches any date where the day part is any number 01-31, the month part is any number 01-12, and the year part is any number 1900-2003. The only invalid dates that it matches are ones where the day part may be in the range 01-31 but that range might not be valid for the specified month. An example of an invalid date that it would allow to pass through would be 11/31/2002. This date is invalid because 11/31 of any year does not exist, but this expression would allow it pass through since the day part is in the range 01-31.
This regular expression has been used successfully in ASP with VBScript using the windows scripting library RegExp object. |
Matches |
12/31/2003 | 01/01/1900 | 11/31/2002 |
Non-Matches |
1/1/2002 | 01/01/02 | 01/01/2004 |
Author |
Rating:
Not yet rated.
Josh Bailyr
|
Title |
Test
Details
Pattern Title
|
Expression |
^[a-zA-Z][0-9][a-zA-Z]\s?[0-9][a-zA-Z][0-9]$ |
Description |
Match Canadia Zip Code. You can have a space in the middle Like T2P 3C7, or no space like T2P3C7 |
Matches |
T2p 3c7 | T3P3c7 | T2P 3C7 |
Non-Matches |
123456 | 3C7T2P | 11T21RWW |
Author |
Rating:
Qing Jiang
|
Displaying page
of
pages;
Items to