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
Pattern Title
|
Expression |
^\d{3}-\d{2}-\d{4}$ |
Description |
This regular expression will match a hyphen-separated Social Security Number (SSN) in the format NNN-NN-NNNN. |
Matches |
333-22-4444 | 123-45-6789 |
Non-Matches |
123456789 | SSN |
Author |
Rating:
Not yet rated.
Steven Smith
|
Title |
Test
Details
Alphanumeric
|
Expression |
^[a-zA-Z0-9]+$ |
Description |
Matches any alphanumeric string (no spaces). |
Matches |
10a | ABC | A3fg |
Non-Matches |
45.3 | this or that | $23 |
Author |
Rating:
Not yet rated.
Steven Smith
|
Title |
Test
Details
Strongish Password
|
Expression |
^[a-zA-Z]\w{3,14}$ |
Description |
The password's first character must be a letter, it must contain at least 4 characters and no more than 15 characters and no characters other than letters, numbers and the underscore may be used |
Matches |
abcd | aBc45DSD_sdf | password |
Non-Matches |
afv | 1234 | reallylongpassword |
Author |
Rating:
Not yet rated.
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
Date With Slashes
|
Expression |
^\d{1,2}\/\d{1,2}\/\d{4}$ |
Description |
This regular expressions matches dates of the form XX/XX/YYYY where XX can be 1 or 2 digits long and YYYY is always 4 digits long. |
Matches |
4/1/2001 | 12/12/2001 | 55/5/3434 |
Non-Matches |
1/1/01 | 12 Jan 01 | 1-1-2001 |
Author |
Rating:
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
foo |
Description |
The "hello world" of regular expressions, this will match any string with an instance of 'foo' in it. |
Matches |
foo |
Non-Matches |
bar |
Author |
Rating:
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
^[1-5]$ |
Description |
This matches a single numeric digit between 1 and 5, and is the same as saying ^[12345]$. |
Matches |
1 | 3 | 4 |
Non-Matches |
6 | 23 | a |
Author |
Rating:
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
^[12345]$ |
Description |
This matches a single numeric digit between 1 and 5, and is the same as saying ^[1-5]$. |
Matches |
1 | 2 | 4 |
Non-Matches |
6 | -1 | abc |
Author |
Rating:
Not yet rated.
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$ |
Description |
This expression matches email addresses, and checks that they are of the proper form. It checks to ensure the top level domain is between 2 and 4 characters long, but does not check the specific domain against a list (especially since there are so many of them now). |
Matches |
|
Non-Matches |
a@b | notanemail | joe@@. |
Author |
Rating:
Steven Smith
|
Title |
Test
Details
Pattern Title
|
Expression |
^[2-9]\d{2}-\d{3}-\d{4}$ |
Description |
This expression matches a hyphen separated US phone number, of the form ANN-NNN-NNNN, where A is between 2 and 9 and N is between 0 and 9. |
Matches |
800-555-5555 | 333-444-5555 | 212-666-1234 |
Non-Matches |
000-000-0000 | 123-456-7890 | 2126661234 |
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
|
Displaying page
of
pages;
Items to