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

Please support RegExLib Sponsors

Sponsors

Browse Expressions by Category

91 regular expressions found in this category!

Expressions in category: Strings

Change page:   |    Displaying page 1 of 5 pages; Items 1 to 20
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: The rating for this expression. 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: The rating for this expression. 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: The rating for this expression. 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: The rating for this expression. 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: The rating for this expression. 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: The rating for this expression. 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: The rating for this expression. 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: The rating for this expression. 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: The rating for this expression. Gregory Lyons
Title Test Details Pattern Title
Expression
(Ù|Ú|Û|Ü|ù|ú|û|ü|µ|U|u|µ|µ|Ù|Ú|Û|Ü|Ù|Ú|Û|Ü|ù|ú|ûü|ù|ú|û|ü)
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: The rating for this expression. 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: The rating for this expression. 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: The rating for this expression. 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: The rating for this expression. 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 &lt;lastname&gt;&lt;suffix&gt;,&lt;prefix&gt;&lt;firstname&gt;&lt;mname&gt; Names must start with a capital letter. Last names may be hyphenated. First names can have two parts ie &quot;Mary Anne&quot; 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: The rating for this expression. 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: The rating for this expression. 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: The rating for this expression. Sonal Bordia
Title Test Details Pattern Title
Expression
^((Bob)|(John)|(Mary)).*$(?<!White)
Description
&quot;Starts with but does not end with.&quot; 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: The rating for this expression. 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: The rating for this expression. Rehan Azam
Title Test Details Pattern Title
Expression
(&#200;|&#201;|&#202;|&#203;|&#232;|&#233;|&#234;|&#235;|&amp;#069;|&amp;#101;|&amp;#200;|&amp;#201;|&amp;#202;|&amp;#203;|&amp;Egrave;|&amp;Eacute;|&amp;Ecirc;|&amp;Euml;|&amp;#232;|&amp;#233;|&amp;#234;|&amp;#235;|&amp;egrave;|&amp;eacute;|&amp;ecirc;|&amp;euml;)
Description
Spam stopper, catches non english characters used in flocks.
Matches
&#203;very one | &#203;nlarg&#235;m&#234;nt | b&#234;st &#235;ver
Non-Matches
Every one | Enlargement | best ever
Author Rating: The rating for this expression. Alanski Perryman
Title Test Details Pattern Title
Expression
(&#161;|&#204;|&#205;|&#206;|&#207;|&#236;|&#237;|&#238;|&#239;|&amp;#033;|&amp;#161;|&amp;iexcl;|&amp;#185;|&amp;sup1;|&amp;brvbar;|&amp;Igrave;|&amp;Iacute;|&amp;Icirc;|&amp;Iuml;|&amp;igrave;|&amp;iacute;|&amp;iuml;|&amp;#204;|&amp;#205;|&amp;#206;|&amp;#207;|&amp;#236;|&amp;#237;|&amp;#238;|&amp;#239;|&amp;#073;|&amp;#105;)
Description
Spam stopper, catches any non english characters for i used in flocks
Matches
&#237;nvest today | &#206;s your | &#239;nto debt
Non-Matches
invest today | Is your | into debt
Author Rating: The rating for this expression. Alanski Perryman
Change page:   |    Displaying page 1 of 5 pages; Items 1 to 20

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