104 regular expressions found in this category!
Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
^(?:(?<1>[(])?(?<AreaCode>[2-9]\d{2})(?(1)[)])(?(1)(?<2>[ ])|(?:(?<3>[-])|(?<4>[ ])))?)?(?<Prefix>[1-9]\d{2})(?(AreaCode)(?:(?(1)(?(2)[- ]|[-]?))|(?(3)[-])|(?(4)[- ]))|[- ]?)(?<Suffix>\d{4})(?:[ ]?[xX]?(?<Ext>\d{2,4}))?$ |
Description |
Regular expression for validating US telephone numbers with OPTIONAL area code, and OPTIONAL extension. Matches various permutations of formatting characters (parenthesis, space, dash). Parses the telephone number area code, prefix, suffix, and extension to named groups to facilitate program manipulation. Area code is optional and can optionally be enclosed in parentheses. Rejects area codes that begin with 0 or 1 and prefixes that begin with 0. Extension is optional and can be optionally preceded by a space and/or "x" or "X", and matches on 2 to 4 digits. Rejects all telephone numbers that do not match on exactly 7 digits, or on exactly 10 digits with the optional area code, not counting the extension or the formatting characters. |
Matches |
333-4444 | (222) 333-4444 | 222-333-4444 X55 |
Non-Matches |
222333 4444 | (222)-333 4444 | 333-4444-5555 |
Author |
Rating:
Jerry Schmersahl
|
Title |
Test
Details
Pattern Title
|
Expression |
^((AL)|(AK)|(AS)|(AZ)|(AR)|(CA)|(CO)|(CT)|(DE)|(DC)|(FM)|(FL)|(GA)|(GU)|(HI)|(ID)|(IL)|(IN)|(IA)|(KS)|(KY)|(LA)|(ME)|(MH)|(MD)|(MA)|(MI)|(MN)|(MS)|(MO)|(MT)|(NE)|(NV)|(NH)|(NJ)|(NM)|(NY)|(NC)|(ND)|(MP)|(OH)|(OK)|(OR)|(PW)|(PA)|(PR)|(RI)|(SC)|(SD)|(TN)|(TX)|(UT)|(VT)|(VI)|(VA)|(WA)|(WV)|(WI)|(WY))$ |
Description |
This validates the states and territories of the United States in a 2 character uppercase format. Very poor excuse for a regular expression! ;)
Written by Jason Gaylord. |
Matches |
NY | PA | NJ |
Non-Matches |
Pennsylvania | Pa | pa |
Author |
Rating:
Jason N. Gaylord
|
Title |
Test
Details
Pattern Title
|
Expression |
^[a-zA-Z0-9ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïñòóôõöøùúûüýÿ\.\,\-\/\']+[a-zA-Z0-9ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïñòóôõöøùúûüýÿ\.\,\-\/\' ]+$ |
Description |
This simple regexp should match any possible italian address entry and doesn't match NULL entries (good if address is required). Should work well for any other address (it's been verified against 250 addresses from most european countries, usa and australia. Please mail me if there's something missing |
Matches |
v.le dell'industria 45/a | via genova 45-3-d | p.zza Garibaldi, 48 |
Non-Matches |
[NULL] |
Author |
Rating:
paolo beltrami
|
Title |
Test
Details
Pattern Title
|
Expression |
^[a-zA-Z\d]+(([\'\,\.\- #][a-zA-Z\d ])?[a-zA-Z\d]*[\.]*)*$ |
Description |
Address
It has now been enhanced to accept # too!! |
Matches |
393 12th St. City, State Zip code |
Non-Matches |
12 street @@@ |
Author |
Rating:
Not yet rated.
Sadaf Ahmed
|
Title |
Test
Details
Pattern Title
|
Expression |
^[S-s]( |-)?[1-9]{1}[0-9]{2}( |-)?[0-9]{2}$ |
Description |
Swedish postcodes (as far as i know) |
Matches |
S-123 45 | s 123 45 | S123-45 |
Non-Matches |
Se12345 |
Author |
Rating:
Not yet rated.
paul Snabilie
|
Title |
Test
Details
Pattern Title
|
Expression |
(?<Telephone>([0-9]|[ ]|[-]|[\(]|[\)]|ext.|[,])+)([ ]|[:]|\t|[-])*(?<Where>Home|Office|Work|Away|Fax|FAX|Phone)|(?<Where>Home|Office|Work|Away|Fax|FAX|Phone|Daytime|Evening)([ ]|[:]|\t|[-])*(?<Telephone>([0-9]|[ ]|[-]|[\(]|[\)]|ext.|[,])+)|(?<Telephone>([(]([0-9]){3}[)]([ ])?([0-9]){3}([ ]|-)([0-9]){4})) |
Description |
Its extracts telephone numbers |
Matches |
(913) 451-6461 |
Non-Matches |
3523d3adb3 |
Author |
Rating:
Not yet rated.
Manpreet Grewal
|
Title |
Test
Details
Pattern Title
|
Expression |
^[D-d][K-k]-[1-9]{1}[0-9]{3}$ |
Description |
Postalcode Danmark |
Matches |
Dk-1234 | dk-1234 | DK-1234 |
Non-Matches |
DK 1234 | DK 12345 |
Author |
Rating:
Not yet rated.
paul Snabilie
|
Title |
Test
Details
Pattern Title
|
Expression |
(\d{4,6}) |
Description |
Simple Postcode - this is the first test of the new WebService :-) |
Matches |
4078 | 539999 |
Non-Matches |
dfasdf | afasdfsad |
Author |
Rating:
Not yet rated.
Darren Neimke
|
Title |
Test
Details
Modified UK Phone Number
|
Expression |
^(((\+44\s?\d{4}|\(?0\d{4}\)?)\s?\d{3}\s?\d{3})|((\+44\s?\d{3}|\(?0\d{3}\)?)\s?\d{3}\s?\d{4})|((\+44\s?\d{2}|\(?0\d{2}\)?)\s?\d{4}\s?\d{4}))(\s?\#(\d{4}|\d{3}))?$ |
Description |
Modified version of UK phone number regular expression. Now allows +44 national code in addition to extension numbers of 3 or 4 digits. Previous expression was: ^((\(?0\d{4}\)?\s?\d{3}\s?\d{3})|(\(?0\d{3}\)?\s?\d{3}\s?\d{4})|(\(?0\d{2}\)?\s?\d{4}\s?\d{4}))(\s?#(\d{4}|\d{3}))?$ |
Matches |
+447222555555 | +44 7222 555 555 | (0722) 5555555 #2222 |
Non-Matches |
(+447222)555555 | +44(7222)555555 | (0722) 5555555 #22 |
Author |
Rating:
Not yet rated.
Amos Hurd
|
Title |
Test
Details
Pattern Title
|
Expression |
^[D-d][K-k]( |-)[1-9]{1}[0-9]{3}$ |
Description |
match all danish postal code
update from last danish postal code expression |
Matches |
DK-1234 | dk 1234 | Dk-1234 |
Non-Matches |
DK 12345 |
Author |
Rating:
Not yet rated.
paul Snabilie
|
Title |
Test
Details
Pattern Title
|
Expression |
(^\d{5}$)|(^\d{5}-\d{4}$) |
Description |
I know its probaly in the library, but i did not see it.
US zip pattern
5 digits 01234 or 5 digits + 4 01234-1234 |
Matches |
12345 | 12345-6789 | 01234 |
Non-Matches |
1A234 | 12345-aaaa | 12345 1234 |
Author |
Rating:
Not yet rated.
Jay Solomon
|
Title |
Test
Details
UK Mobile Phone Number
|
Expression |
^(\+44\s?7\d{3}|\(?07\d{3}\)?)\s?\d{3}\s?\d{3}$ |
Description |
UK mobile phone number, with optional +44 national code. Allows optional brackets and spaces at appropriate positions. |
Matches |
07222 555555 | (07222) 555555 | +44 7222 555 555 |
Non-Matches |
7222 555555 | +44 07222 555555 | (+447222) 555555 |
Author |
Rating:
Not yet rated.
Amos Hurd
|
Title |
Test
Details
UK Phone Number
|
Expression |
^((\(?0\d{4}\)?\s?\d{3}\s?\d{3})|(\(?0\d{3}\)?\s?\d{3}\s?\d{4})|(\(?0\d{2}\)?\s?\d{4}\s?\d{4}))(\s?\#(\d{4}|\d{3}))?$ |
Description |
UK phone number. Allows 3, 4 or 5 digit regional prefix, with 8, 7 or 6 digit phone number respectively, plus optional 3 or 4 digit extension number prefixed with a # symbol. Also allows optional brackets surrounding the regional prefix and optional spaces between appropriate groups of numbers. |
Matches |
01222 555 555 | (010) 55555555 #2222 | 0122 555 5555#222 |
Non-Matches |
01222 555 5555 | (010) 55555555 #22 | 0122 5555 5555#222 |
Author |
Rating:
Not yet rated.
Amos Hurd
|
Title |
Test
Details
Pattern Title
|
Expression |
^([\+][0-9]{1,3}[\.][0-9]{1,12})([x]?[0-9]{1,4}?)$ |
Description |
Validates on the following standards:
+CCC.ZZZZZZZZZZxYYYY, where 'C' is the numeric
country phone code (up to three digits), 'Z' is the phone number (up to
12 digits) and 'Y' is the extension (up to 4 digits); max length overall is
20 characters, including the '+', '.', and 'x' (if extension is present).
Useful for people communicating with the OpenSRS API |
Matches |
+800.4453377x4444 | +80.4453377 | +8.123456789123x1111 |
Non-Matches |
181823884499 | +800.4453377x | 2486994x11 |
Author |
Rating:
Not yet rated.
Hayk A
|
Title |
Test
Details
Pattern Title
|
Expression |
^([+]39)?((38[{8,9}|0])|(34[{7-9}|0])|(36[6|8|0])|(33[{3-9}|0])|(32[{8,9}]))([\d]{7})$ |
Description |
Validates a Italian mobile phone number with (or without) the International code |
Matches |
+393471234567 | 3381234567 |
Non-Matches |
+39 3401234567 | 347 1234567 | 338-1234567 |
Author |
Rating:
Not yet rated.
Fabrizio Fortini
|
Title |
Test
Details
Pattern Title
|
Expression |
^(\(?\d\d\d\)?)?( |-|\.)?\d\d\d( |-|\.)?\d{4,4}(( |-|\.)?[ext\.]+ ?\d+)?$ |
Description |
Basic US phone number matching pattern. I found this place and used a regex, so figured I'd share. |
Matches |
(888) 555-1212 | 888.555.1212 | (888) 555.1212 ext. 1212 |
Non-Matches |
(800) got-fish | 011+ 78907 2344323 |
Author |
Rating:
Not yet rated.
Jon Stephens
|
Title |
Test
Details
Pattern Title
|
Expression |
([\(]?(?<AreaCode>[0-9]{3})[\)]?)?[ \.\-]?(?<Exchange>[0-9]{3})[ \.\-](?<Number>[0-9]{4}) |
Description |
This was used to process a bunch of lines of information to determine if a line was a North American phone number or not. It accepts numbers with or without area code with or without parenthesis and sepearated by space, dash or period. |
Matches |
(602) 555-3696 | 555-2069 | 213.555.8954 |
Non-Matches |
225-582 | 11000 |
Author |
Rating:
Not yet rated.
Jared Tullis
|
Title |
Test
Details
Pattern Title
|
Expression |
^[01]?[- .]?\(?[2-9]\d{2}\)?[- .]?\d{3}[- .]?\d{4}$ |
Description |
U. S. or Canadian telephone number regular expression. <BR>
<BR>
// # Checks phone numbers for validity <BR>
// [01]? # optional '0', or '1' <BR>
// [- .]? # optional separator is either a dash, a space, or a period. <BR>
// \(? # optional parentheses <BR>
// [2-9] # first # of the area code must not be a '0' or '1' <BR>
// \d{2} # next 2 digits of area code can be 0-9 <BR>
// \)? # optional parentheses <BR>
// [- .]? # optional separator is either a dash, a space, or a period. <BR>
// \d{3} # 3-digit prefix <BR>
// [- .]? # optional separator is either a dash, a space, or a period. <BR>
// \d{4} # 4-digit station number <BR>
|
Matches |
18008793262 | 800-879-3262 | 0-800.879.3262 |
Non-Matches |
879 3262 | 077 879 3262 | 879-3262 |
Author |
Rating:
Not yet rated.
W. D.
|
Title |
Test
Details
Pattern Title
|
Expression |
^([8-9])([1-9])(\d{2})(-?|\040?)(\d{4})$ |
Description |
A regular expression that validates the any of the new formats of cellular phones numbers in Peru, allows an optional dash in the middle of the number. |
Matches |
8874-2544 | 99106800 | 84509955 |
Non-Matches |
6540-9985 | 77329390 | 725-2763 |
Author |
Rating:
Not yet rated.
Alan Ferrandiz Langley
|
Title |
Test
Details
Pattern Title
|
Expression |
^([2-9])(\d{2})(-?|\040?)(\d{4})( ?|\040?)(\d{1,4}?|\040?)$ |
Description |
A regular expression that validates the any format of fixed telephone numbers inside Lima - Peru, including an optional extension of at least one number up to four numbers. |
Matches |
263-8854 | 5660578 1235 | 622-4588 21 |
Non-Matches |
1227585 | 4224586 50124 | 0554499 |
Author |
Rating:
Not yet rated.
Alan Ferrandiz Langley
|
Displaying page
of
pages;
Items to