91 regular expressions found in this category!
Displaying page
of
pages;
Items to
| 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 (?<field1>[^,]+) 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. (?<field1>[^;]+); 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 "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 "pharmacy" |
| Matches |
phaaarmacy | pphhaarrmmaaccyy | ppharmacy |
| Non-Matches |
armacy |
| Author |
Rating:
Not yet rated.
Louis Ostendorf
|
| 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:
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
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 |
(Ù|Ú|Û|Ü|ù|ú|û|ü|µ|&#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:
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 |
(¡|Ì|Í|Î|Ï|ì|í|î|ï|&#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:
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 |
(Ò|Ó|Ô|Õ|Ö|Ø|ð|ò|ó|ô|õ|ö|ø|&#048;|&#079;|&#111;|&#210;|&#211;|&#212;|&#213;|&#214;|&#216;|&Ograve;|&Oacute;|&Ocirc;|&Otilde;|&Ouml;|&Oslash;|&#242;|&#243;|&#244;|&#245;|&ograve;|&oacute;|&ocirc;|&otilde;|&ouml;|&oslash;) |
| Description |
Spam stopper, catches any non english characters used for o in flocks |
| Matches |
Ônly $20 | Øne tô Óne | gõ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 > 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 |
(À|Á|Â|Ã|Ä|Å|à|á|â|ã|ä|å|&#097;|&#065;|&#064;|&commat;|&alpha;|&#192;|&#193;|&#194;|&#195;|&#196;|&#197;|&Agrave;|&Aacute;|&Acirc;|&Atilde;|&Auml;|&Aring;|&#224;|&#225;|&#226;|&#227;|&#228;|&#229;|&agrave;|&aacute;|&acirc;|&atilde;|&auml;|&aring;) |
| Description |
spam stopper, catches non english language flocks for letter A |
| Matches |
ENLÃRGMENT | àll new | eã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
|
Displaying page
of
pages;
Items to