91 regular expressions found in this category!
Displaying page
of
pages;
Items to
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 |
(\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 |
^\.([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
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 |
^(?=.*\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
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:
Not yet rated.
Sonal Bordia
|
Title |
Test
Details
Pattern Title
|
Expression |
^([34|37]{2})([0-9]{13})$ |
Description |
Validate against any american express number. All american express numbers start with either a 34 or 37, followed by 13 other numbers. |
Matches |
341256321524212 | 371524254523125 |
Non-Matches |
425152365212542 | 34256321523621 | 3712563212523651 |
Author |
Rating:
Not yet rated.
Jeff Johns
|
Title |
Test
Details
Pattern Title
|
Expression |
^([4]{1})([0-9]{12,15})$ |
Description |
Validate against a visa card number. All visa cards start with a 4 and are followed by 12 to 15 more numbers. |
Matches |
4125632152365 | 418563256985214 | 4125632569856321 |
Non-Matches |
3125652365214 | 41256321256 | 42563985632156322 |
Author |
Rating:
Not yet rated.
Jeff Johns
|
Title |
Test
Details
Pattern Title
|
Expression |
(\S*)+(\u007C)+(\S*) |
Description |
Useful for grabbing pipe delimited text from a string. |
Matches |
this is a sentence with tokens alpha|bravo|charlie |
Non-Matches |
only pipes not alpha,bravo |
Author |
Rating:
Not yet rated.
Richard Johnn
|
Title |
Test
Details
Pattern Title
|
Expression |
^([6011]{4})([0-9]{12})$ |
Description |
Validate against any discover card number. All DC's start with 6011 and are followed by 12 other numbers. |
Matches |
6011212541254121 | 6011523654125685 |
Non-Matches |
5021152365212541 | 601126523652321 | 60112563212563215 |
Author |
Rating:
Not yet rated.
Jeff Johns
|
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 |
(\S+)\x20{2,}(?=\S+) |
Description |
Trim Inside. This pattern can be used with a replace value of "$1 " to remove multiple consecutive spaces between characters and replace with a single space. Trailing and leading spaces are NOT altered. |
Matches |
Too Many spaces. |
Non-Matches |
No extra spaces | No Extra spaces Inside |
Author |
Rating:
Not yet rated.
Michael Ash
|
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:
Not yet rated.
Mike Reeves-McMillan
|
Title |
Test
Details
Pattern Title
|
Expression |
(À|Á|Â|Ã|Ä|Å|à|á|â|ã|ä|å|a|A|@|@|α|À|Á|Â|Ã|Ä|Å|À|Á|Â|Ã|Ä|Å|à|á|â|ã|ä|å|à|á|â|ã|ä|å) |
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 |
^([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 |
^(?=((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 |
(\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
|
Title |
Test
Details
Pattern Title
|
Expression |
[\\s+,] |
Description |
Simple expression for matching all commas and all whitespace characters: ASCII (13,10,44) |
Matches |
, | whitespace | carrage returns |
Non-Matches |
cat |
Author |
Rating:
Not yet rated.
andrew stone
|
Title |
Test
Details
Pattern Title
|
Expression |
(?<FirstName>[A-Z]\.?\w*\-?[A-Z]?\w*)\s?(?<MiddleName>[A-Z]\w+|[A-Z]?\.?)\s(?<LastName>[A-Z]?\w{0,3}[A-Z]\w+\-?[A-Z]?\w*)(?:,\s|)(?<Suffix>Jr\.|Sr\.|IV|III|II|) |
Description |
Fine-tuned the previous version to handle surnames with embedded caps like McCoy and DeCarlo. |
Matches |
David Walker | Bob MacDonald | Yvonne DeCarlo |
Non-Matches |
oscar peterson |
Author |
Rating:
Not yet rated.
David Walker
|
Displaying page
of
pages;
Items to