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 2 of 5 pages; Items 21 to 40
Title Test Details Pattern Title
Expression
"((\\")|[^"(\\")])+"
Description
Matches quoted string, using \" as an escape to place quotes in the string
Matches
"test" | "escape\"quote" | "\""
Non-Matches
test | "test | "test\"
Author Rating: The rating for this expression. Alessandro Vergani
Title Test Details Pattern Title
Expression
<[^>]+>
Description
This expression finds all opening and closing tags. Good for stripping out tags in an XML or HTML document. I used it to clean-up HTML documents that had XML mixed in. It found all the tags, then I just deleted the ones that weren't standard. I used it in HOMESITES extended find.
Matches
<html> | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | <
Non-Matches
Any plain old text | http://www.regexlib.com/Add.aspx | xml>
Author Rating: The rating for this expression. X Man
Title Test Details Pattern Title
Expression
^([51|52|53|54|55]{2})([0-9]{14})$
Description
Validate against any mastercard number. All MC's start with a number between 51 and 55 and are followed by 14 other numbers.
Matches
5125632154125412 | 5225632154125412 | 5525632154125412
Non-Matches
5625632154125412 | 4825632154125412 | 6011632154125412
Author Rating: The rating for this expression. Jeff Johns
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 Older UK Vehicle Registration
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: Not yet rated. Amos Hurd
Title Test Details Pattern Title
Expression
(&#192;|&#193;|&#194;|&#195;|&#196;|&#197;|&#224;|&#225;|&#226;|&#227;|&#228;|&#229;|&amp;#097;|&amp;#065;|&amp;#064;|&amp;commat;|&amp;alpha;|&amp;#192;|&amp;#193;|&amp;#194;|&amp;#195;|&amp;#196;|&amp;#197;|&amp;Agrave;|&amp;Aacute;|&amp;Acirc;|&amp;Atilde;|&amp;Auml;|&amp;Aring;|&amp;#224;|&amp;#225;|&amp;#226;|&amp;#227;|&amp;#228;|&amp;#229;|&amp;agrave;|&amp;aacute;|&amp;acirc;|&amp;atilde;|&amp;auml;|&amp;aring;)
Description
spam stopper, catches non english language flocks for letter A
Matches
ENL&#195;RGMENT | &#224;ll new | e&#227;sy go
Non-Matches
ENLARGMENT | all new | easy go
Author Rating: Not yet rated. Alanski Perryman
Title Test Details Pattern Title
Expression
(?n:(^(?(?![^,]+?,)((?<first>[A-Z][a-z]*?) )?((?<second>[A-Z][a-z]*?) )?((?<third>[A-Z][a-z]*?) )?)(?<last>[A-Z](('|[a-z]{1,2})[A-Z])?[a-z]+))(?(?=,)(, (?<first>[A-Z][a-z]*?))?( (?<second>[A-Z][a-z]*?))?( (?<third>[A-Z][a-z]*?))?)$)
Description
Regular expression for validating a person's full name. Matches on two general formats: 1) first second third last (where first, second, and third names are optional and all present are separated by a space); 2) last, first second third (where second and third are optional, last is followed immediately by a comma and a space, and second, and third, if present, are separated by a space from each other and from first). First corresponds to surname and last corresponds to family name. Each name part is captured to a named group to facilitate program manipulation. Each name part must begin with an uppercase letter, followed by zero or more lowercase letters, except for the last name. Last name must begin with an uppercase letter, followed by one or more lowercase letters, but will match exceptions formatted like the following: McD..., MacD..., O'R... Only format is validated, not spelling. NOTE: This regular expression uses positive and negative regex lookahead to determine the general format of the name, i.e. the presence or the absence of the comma determines the general format that will match. Furthermore, this initial version is not designed to accommodate titles and things like &quot;3rd&quot;.
Matches
John Paul Jones | Jones, John P | Jones
Non-Matches
Paul Jones, John | John J | Mr. John Paul Jones 3rd
Author Rating: Not yet rated. Jerry Schmersahl
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: Not yet rated. Alanski Perryman
Title Test Details Pattern Title
Expression
(&#217;|&#218;|&#219;|&#220;|&#249;|&#250;|&#251;|&#252;|&#181;|&amp;#085;|&amp;#117;|&amp;#181;|&amp;micro;|&amp;#217;|&amp;#218;|&amp;#219;|&amp;#220;|&amp;Ugrave;|&amp;Uacute;|&amp;Ucirc;|&amp;Uuml;|&amp;#249;|&amp;#250;|&amp;#251;&amp;#252;|&amp;ugrave;|&amp;uacute;|&amp;ucirc;|&amp;uuml;)
Description
Spam stopper, catches any non english characters for u used in flocks
Matches
&#220;s&#250;ally $40 | &#250;nless you act | &#181;pper limit
Non-Matches
Usually $40 | unless you act | upper limit
Author Rating: Not yet rated. Alanski Perryman
Title Test Details Pattern Title
Expression
(&#210;|&#211;|&#212;|&#213;|&#214;|&#216;|&#240;|&#242;|&#243;|&#244;|&#245;|&#246;|&#248;|&amp;#048;|&amp;#079;|&amp;#111;|&amp;#210;|&amp;#211;|&amp;#212;|&amp;#213;|&amp;#214;|&amp;#216;|&amp;Ograve;|&amp;Oacute;|&amp;Ocirc;|&amp;Otilde;|&amp;Ouml;|&amp;Oslash;|&amp;#242;|&amp;#243;|&amp;#244;|&amp;#245;|&amp;ograve;|&amp;oacute;|&amp;ocirc;|&amp;otilde;|&amp;ouml;|&amp;oslash;)
Description
Spam stopper, catches any non english characters used for o in flocks
Matches
&#212;nly $20 | &#216;ne t&#244; &#211;ne | g&#245;ing today
Non-Matches
Only $20 | One to one | going today
Author Rating: Not yet rated. Alanski Perryman
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: Not yet rated. Alanski Perryman
Title Test Details Current UK Vehicle Registration
Expression
^([A-HK-PRSVWY][A-HJ-PR-Y])\s?([0][2-9]|[1-9][0-9])\s?[A-HJ-PR-Z]{3}$
Description
UK vehicle registration system currently in use (as defined by the DVLA and put into effect from September 2001, and therefore does not allow registrations prior to this date).
Matches
AB51DVL | AB 51 DVL
Non-Matches
AZ01DLQ | AZ 01 DLQ
Author Rating: Not yet rated. Amos Hurd
Title Test Details Pattern Title
Expression
^(?:(?<Visa>4\d{3})|(?<Mastercard>5[1-5]\d{2})|(?<Discover>6011)|(?<DinersClub>(?:3[68]\d{2})|(?:30[0-5]\d))|(?<AmericanExpress>3[47]\d{2}))([ -]?)(?(DinersClub)(?:\d{6}\1\d{4})|(?(AmericanExpress)(?:\d{6}\1\d{5})|(?:\d{4}\1\d{4}\1\d{4})))$
Description
Updated on 7 Jun 2005 -- Matches major credit cards including: Visa (length 16, prefix 4); Mastercard (length 16, prefix 51-55); Diners Club/Carte Blanche (length 14, prefix 36, 38, or 300-305); Discover (length 16, prefix 6011); American Express (length 15, prefix 34 or 37). Saves the card type as a named group to facilitate further validation against a &quot;card type&quot; checkbox in a program. All 16 digit formats are grouped 4-4-4-4 with an optional hyphen or space between each group of 4 digits. The American Express format is grouped 4-6-5 with an optional hyphen or space between each group of digits. Formatting characters must be consistant, i.e. if two groups are separated by a hyphen, all groups must be separated by a hyphen for a match to occur.
Matches
4111-2222-3333-4444 | 3411 222222 33333 | 5111222233334444
Non-Matches
4111-2222-3333-444 | 3411-2222-3333-4444 | Visa
Author Rating: Not yet rated. Jerry Schmersahl
Title Test Details Pattern Title
Expression
.\{\d\}
Description
String formater matching.
Matches
The quick {0} fox {1} over the lazy dog.
Non-Matches
The {b} is wrong
Author Rating: Not yet rated. Sean Ziencik
Title Test Details Pattern Title
Expression
^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,15}$
Description
Password matching expression. Password must be at least 8 characters, no more than 15 characters, and must include at least one upper case letter, one lower case letter, and one numeric digit.
Matches
aaaa1234AAAA | 12aaAA12 | aaaaa12345AAAAA
Non-Matches
aaaaa123456AAAAA | 12aaAA1 | 12aaaa12
Author Rating: Not yet rated. Jeff U
Title Test Details Pattern Title
Expression
(\b)(\w+(\b|\n|\s)){3}
Description
This script attempts to return phrases from a string (Example above looks for {3} word phrases) Combine this with some .Net code, you can display most popular X word phrases in a string. -If anyone can help me count &quot;Phrase and Phrase as 2 instances of Phrase please contact me
Matches
three blind mice | see how they run
Non-Matches
three blind | they run
Author Rating: Not yet rated. Dan Hall
Title Test Details Pattern Title
Expression
(?i)(pharmacy)|((p(.{1,3})?h(.{1,3})?a(.{1,3})?r(.{1,3)?m(.{1,3})?a(.{1,3})?c(.{1,3})?y))
Description
AntiSpam: matches variations on the word &quot;pharmacy&quot;
Matches
phaaarmacy | pphhaarrmmaaccyy | ppharmacy
Non-Matches
armacy
Author Rating: Not yet rated. Louis Ostendorf
Title Test Details Word Break
Expression
^(?:[ -~]{10,25}(?:$|(?:[\w!?.])\s))
Description
Word Break. This regex can be used to break a long line of text on a full word. The qualifiers specify the minimum and maximum number of character allow before the break and can be changed according to your need. Blogge about this here http://regexadvice.com/blogs/mash/archive/2005/02/09/324.aspx
Matches
This is just a simple sample
Non-Matches
A sample
Author Rating: Not yet rated. Michael Ash
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: Not yet rated. Jack Yang
Title Test Details Pattern Title
Expression
^(?=.*\d)(?=.*[a-zA-Z])(?!.*[\W_\x7B-\xFF]).{6,15}$
Description
Password validator Requires 6-20 characters including at least 1 upper or lower alpha, and 1 digit. It should disallow just about everything else, inluding extended characters.
Matches
abc123 | BA99342bob | 1232z123311
Non-Matches
abcdef | 123456 | 123'ABC
Author Rating: Not yet rated. Tim Conama
Change page:   |    Displaying page 2 of 5 pages; Items 21 to 40

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