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 4 of 5 pages; Items 61 to 80
Title Test Details Parse Comma Delimited Strings
Expression
^(?<field1>[^,]+),(?<field2>[^,]+),(?<field3>[^,]+)$
Description
Example of a regular expression that can be used to parse a comma delimited string into constituent, named sub-strings. Add or remove regex subfield definitions (?&lt;field1&gt;[^,]+) and corresponding delimiting characters in the regular expression as necessary to accommodate the string and subfields you intend to parse. Optionally, rename the subfield names in the regular expression to more meaningful names if you are using the parsed sub-strings in a program. Replace all occurrences of the comma in the regular expression with any required alternative delimiting character. As long as the delimiting character used does not occur naturally in any of the sub-strings, you should be good-to-go. NOTE: To change the delimiter character you must replace all occurrences of the comma in the current regex (of which there are 5) with the new delimiter character. e.g. (?&lt;field1&gt;[^;]+); changes the delimiter character to a semi-colon for the first field.
Matches
Fred,Barnie,Wilma | Bob,1/1/2003,222-3333 | 100,200,300
Non-Matches
Fred,Barnie,Wilma,Betty | Bob;1/1/2003;222-3333 | Tom Dick Harry
Author Rating: Not yet rated. Jerry Schmersahl
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 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 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
Title Test Details UK National Insurance Number
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: Not yet rated. Amos Hurd
Title Test Details Pattern Title
Expression
[AaEeIiOoUuYy]
Description
This simple reg-ex accepts any vowel letter.
Matches
a | o | e
Non-Matches
z | x | w
Author Rating: Not yet rated. Alexander Pinsker
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
^(?=.*\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
(&#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 Combined 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})|(([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. This is the obvious combination of two previous expressions posted here, to merge the older system with the current system.
Matches
ABC 123 A | A 123 ABC | AB 12 ABC
Non-Matches
AB 123 C | A 123 AB | AB 12 AB
Author Rating: Not yet rated. Amos Hurd
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 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
(&#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
.\{\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
^(?=((0[1-9]0)|([1-7][1-7]\d)|(00[1-9])|(0[1-9][1-9]))-(?=(([1-9]0)|(0[1-9])|([1-9][1-9]))-(?=((\d{3}[1-9])$|([1-9]\d{3})$|(\d[1-9]\d{2})$|(\d{2}[1-9]\d)$))))
Description
I wrote this regular expression because a project I was working on required a stricter validator on social security numbers. There are actually gov't standards on what is a valid social: The first 3 digits can't be &gt; 779, The first 3 digits can't be 000, The second 2 digits can't be 00, and the last 4 digits can't be 0000. This regex handles all these cases and checks formatting for numbering and dashes (###-##-####)
Matches
053-27-0293 | 770-29-2012 | 063-71-9123
Non-Matches
780-20-1230 | 000-24-1290 | 123-00-1239
Author Rating: Not yet rated. Scott Long
Title Test Details Pattern Title
Expression
^([1-9]{1}[0-9]{3}[,]?)*([1-9]{1}[0-9]{3})$
Description
Matches a comma-seperated list of year(s).
Matches
1999,2001,1988 | 1999
Non-Matches
0199,1997 | 0199 | 1999,
Author Rating: Not yet rated. Craig Pearson
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
(\b\w+\b) # Match a word and capture it \s+ \1 # Use backreference \1 to match double-ups
Description
Matches
This is is a match
Non-Matches
This isn't!
Author Rating: Not yet rated. Darren Neimke
Change page:   |    Displaying page 4 of 5 pages; Items 61 to 80

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