91 regular expressions found in this category!
Displaying page
of
pages;
Items to
| Title |
Test
Details
Pattern Title
|
| Expression |
^[A-CEGHJ-PR-TW-Z]{1}[A-CEGHJ-NPR-TW-Z]{1}[0-9]{6}[A-DFM]{0,1}$ |
| Description |
UK National Insurance Number (NINo) validation. The following modifications have been made: The first letter may not be D, F, I, Q, U or Z; the second letter may not be D, F, I, O, Q, U or Z; the final letter is optional. |
| Matches |
JG103759A | AP019283D | ZX047829C |
| Non-Matches |
DC135798A | FQ987654C | KL192845T |
| Author |
Rating:
Chris Wicks
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^([30|36|38]{2})([0-9]{12})$ |
| Description |
Validate against any diner's club card. All diner club cards start with 30,36, or 38, followed by 12 other numbers. |
| Matches |
30125212365212 | 36125212365212 | 38125212365212 |
| Non-Matches |
301252123652121 | 40256631125452 | 361251254125212 |
| Author |
Rating:
Jeff Johns
|
| Title |
Test
Details
Pattern Title
|
| Expression |
([^\.\?\!]*)[\.\?\!] |
| Description |
Finds sentences (assuming they end with a full stop, question mark or exclamation mark). |
| Matches |
This is a series of sentences. They end predictably! Where would we be without punctuation? |
| Non-Matches |
This sentence just trails off |
| Author |
Rating:
Mike Reeves-McMillan
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^\s*[a-zA-Z,\s]+\s*$ |
| Description |
Any Expression Upper/Lower Case, with commas and space between the text, with any amount of space before or after |
| Matches |
Smith, Ed | Ed Smith | aBcDeFgH |
| Non-Matches |
a123 | AB5 | Mr. Ed |
| Author |
Rating:
Mart Maasikas
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^((A[ABEHKLMPRSTWXYZ])|(B[ABEHKLMT])|(C[ABEHKLR])|(E[ABEHKLMPRSTWXYZ])|(GY)|(H[ABEHKLMPRSTWXYZ])|(J[ABCEGHJKLMNPRSTWXYZ])|(K[ABEHKLMPRSTWXYZ])|(L[ABEHKLMPRSTWXYZ])|(M[AWX])|(N[ABEHLMPRSWXYZ])|(O[ABEHKLMPRSX])|(P[ABCEGHJLMNPRSTWXY])|(R[ABEHKMPRSTWXYZ])|(S[ABCGHJKLMNPRSTWXYZ])|(T[ABEHKLMPRSTWXYZ])|(W[ABEKLMP])|(Y[ABEHKLMPRSTWXYZ])|(Z[ABEHKLMPRSTWXY]))\d{6}([A-D]|\s)$ |
| Description |
UK National Insurance (NI) Number, updated 14 Dec 2005 and current for 2006. |
| Matches |
NS123456A | AA555555A | ZY654321 |
| Non-Matches |
QB123456A | DD123456D | MB654321X |
| Author |
Rating:
Amos Hurd
|
| Title |
Test
Details
Social Security Number
|
| Expression |
^(?!000)([0-6]\d{2}|7([0-6]\d|7[012]))([ -]?)(?!00)\d\d\3(?!0000)\d{4}$ |
| Description |
This regex validates U.S. social security numbers, within the range of numbers that have been currently allocated. |
| Matches |
078-05-1120 | 078 05 1120 | 078051120 |
| Non-Matches |
987-65-4320 | 000-00-0000 | (555) 555-5555 |
| Author |
Rating:
Michael Ash
|
| Title |
Test
Details
Pattern Title
|
| Expression |
(.)\1{2,} |
| Description |
matches any string with characters repeated more than twice, sometimes used as fake input |
| Matches |
aaaeee | ???????? | gooogle |
| Non-Matches |
google | booboo |
| Author |
Rating:
Bernard Martin-Rabaud
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^(?!^(PRN|AUX|CLOCK\$|NUL|CON|COM\d|LPT\d|\..*)(\..+)?$)[^\x00-\x1f\\?*<>:\;|\"/]+$ |
| Description |
Additional checks for <> and " characters |
| Matches |
abc |
| Non-Matches |
PRN |
| Author |
Rating:
Rahul Pandit
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^([1-9]{1}(([0-9])?){2})+(,[0-9]{1}[0-9]{2})*$ |
| Description |
Matchs comma delimited numbers. Easily changed to allow for other delimiters. (Edit ",")
Does not allow a leading 0
Does not allow groups of numbers with less than 3 numbers, exculding the first group. |
| Matches |
123,123,123,123 | 100,120,000,010,011 | 1,123,123,123 |
| Non-Matches |
012,123,123,123 | 12343,1244,4,12 | ,123,123,123 |
| Author |
Rating:
Gregory Lyons
|
| Title |
Test
Details
Pattern Title
|
| Expression |
(Ù|Ú|Û|Ü|ù|ú|û|ü|µ|&#085;|&#117;|&#181;|&micro;|&#217;|&#218;|&#219;|&#220;|&Ugrave;|&Uacute;|&Ucirc;|&Uuml;|&#249;|&#250;|&#251;&#252;|&ugrave;|&uacute;|&ucirc;|&uuml;) |
| Description |
Spam stopper, catches any non english characters for u used in flocks |
| Matches |
Üsúally $40 | únless you act | µpper limit |
| Non-Matches |
Usually $40 | unless you act | upper limit |
| Author |
Rating:
Alanski Perryman
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^([A-Z]{3}\s?(\d{3}|\d{2}|d{1})\s?[A-Z])|([A-Z]\s?(\d{3}|\d{2}|\d{1})\s?[A-Z]{3})$ |
| Description |
UK vehicle registration system prior to September 2001. Allows both older suffix and the later prefix formats in simple form, with optional spaces. |
| Matches |
ABC123A | A 123 ABC |
| Non-Matches |
AB123A | A 123 AB |
| Author |
Rating:
Amos Hurd
|
| Title |
Test
Details
Pattern Title
|
| Expression |
(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{6,15})$ |
| Description |
I built this expression to test a string in ASP for valid username and password constraints. It can be adapted for any number of scenerios. For instance in this case, we needed to ensure the username someone wanted was not all numbers or all letters and was 6-15 characters in length with no special characters. This expression tests negatively for all number cases, then all letter cases, and lastly tests for only alphanumeric characters in the required range. In other words: the match must be alphanumeric with at least one number, one letter, and be between 6-15 character in length. |
| Matches |
C2dfeed | sporttrak1 | 11223a |
| Non-Matches |
pookie | d34_fff | 123456 |
| Author |
Rating:
Pete Lindquist
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^\.([rR]([aA][rR]|\d{2})|(\d{3})?)$ |
| Description |
RAR file extensions.
Works also with '*.part01.rar' given '.rar' to be the file extension.
Does not support volumes exceed 101 for s## (r99, s00, s01, ...) serie. |
| Matches |
.RAr | .r01 | .012 |
| Non-Matches |
.rxr | .a01 | .0112 |
| Author |
Rating:
Jack Yang
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^(?n:(?<lastname>(St\.\ )?(?-i:[A-Z]\'?\w+?\-?)+)(?<suffix>\ (?i:([JS]R)|((X(X{1,2})?)?((I((I{1,2})|V|X)?)|(V(I{0,3})))?)))?,((?<prefix>Dr|Prof|M(r?|(is)?)s)\ )?(?<firstname>(?-i:[A-Z]\'?(\w+?|\.)\ ??){1,2})?(\ (?<mname>(?-i:[A-Z])(\'?\w+?|\.))){0,2})$ |
| Description |
This pattern captures <lastname><suffix>,<prefix><firstname><mname> Names must start with a capital letter. Last names may be hyphenated. First names can have two parts ie "Mary Anne" if there are more than two names after the comma. Suffixes can number up to XXX (30th). Standard prefixes are optional (Mr Miss) |
| Matches |
O'Brien, Miles | McDonald,Mary Ann Alison | Windsor-Smith,Barry |
| Non-Matches |
jones, john |
| Author |
Rating:
Michael Ash
|
| Title |
Test
Details
Pattern Title
|
| Expression |
[v,V,(\\/)](\W|)[i,I,1,l,L](\W|)[a,A,@,(\/\\)](\W|)[g,G](\W|)[r,R](\W|)[a,A,@,(\/\\))] |
| Description |
Spam trap
Catches many and many way to write viagra (replacing letters with similar chars, spacing chars with one space, etc). |
| Matches |
Viagra | v1@G R /\ | \/iagr@ |
| Non-Matches |
viaagra | vi agra | v1 gra |
| Author |
Rating:
Sante Boscolo
|
| Title |
Test
Details
Pattern Title
|
| Expression |
"[^"\r\n]*" |
| Description |
returns string between two quotes |
| Matches |
Return Parent.DB.GetDataReader("CauseImmediateGet", MyIncidentEventTypeID) |
| Non-Matches |
Return Parent.DB.GetDataReader(CauseImmediateGet", MyIncidentEventTypeID) |
| Author |
Rating:
Sonal Bordia
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^((Bob)|(John)|(Mary)).*$(?<!White) |
| Description |
"Starts with but does not end with."
I needed a pattern to require certain first (and optional middle) names, but to fail for certain last names. So if Bob, John, and Mary are acceptable first names but the White's are always rejected then...
|
| Matches |
Bob Jones | John Smith | Mary Jane Smith |
| Non-Matches |
Bob White | Mary Doe White | Gina Smith |
| Author |
Rating:
Eli Robillard
|
| Title |
Test
Details
Pattern Title
|
| Expression |
^([A-Za-z0-9]\s?)+([,]\s?([A-Za-z0-9]\s?)+)*$ |
| Description |
This regular expression can be used to parse a comma delimited string. Leading whitespaces (at the beginning of the entire string) and ending commas are not acceptable. Any combination of letters and numbers with zero or one white space between them are acceptable. Note: To change the delimiter, simply replace the comma in the square brackets to the delimiter of choice. |
| Matches |
123, 4567, 8901 | abc, defghi, jklmn | abc123 |
| Non-Matches |
abc123 | abc123, | ,abc123 |
| Author |
Rating:
Rehan Azam
|
| Title |
Test
Details
Pattern Title
|
| Expression |
(È|É|Ê|Ë|è|é|ê|ë|&#069;|&#101;|&#200;|&#201;|&#202;|&#203;|&Egrave;|&Eacute;|&Ecirc;|&Euml;|&#232;|&#233;|&#234;|&#235;|&egrave;|&eacute;|&ecirc;|&euml;) |
| Description |
Spam stopper, catches non english characters used in flocks. |
| Matches |
Ëvery one | Ënlargëmênt | bêst ëver |
| Non-Matches |
Every one | Enlargement | best ever |
| Author |
Rating:
Alanski Perryman
|
| Title |
Test
Details
Pattern Title
|
| Expression |
(¡|Ì|Í|Î|Ï|ì|í|î|ï|&#033;|&#161;|&iexcl;|&#185;|&sup1;|&brvbar;|&Igrave;|&Iacute;|&Icirc;|&Iuml;|&igrave;|&iacute;|&iuml;|&#204;|&#205;|&#206;|&#207;|&#236;|&#237;|&#238;|&#239;|&#073;|&#105;) |
| Description |
Spam stopper, catches any non english characters for i used in flocks |
| Matches |
ínvest today | Îs your | ïnto debt |
| Non-Matches |
invest today | Is your | into debt |
| Author |
Rating:
Alanski Perryman
|
Displaying page
of
pages;
Items to