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 3 of 5 pages; Items 41 to 60
Title Test Details Pattern Title
Expression
.*[Vv][Ii1]agr.*
Description
Spam Stopper
Matches
V1agra
Non-Matches
na
Author Rating: Not yet rated. Alanski Perryman
Title Test Details Pattern Title
Expression
(?<LastName>[A-Z]\w+\-?[A-Z]?\w*),\s(?<Suffix>Jr\.|Sr\.|IV|III|II)?,?\s?(?<FirstName>[A-Z]\w*\-?[A-Z]?\w*\.?)\s?(?<MiddleName>[A-Z]?\w*\.?)
Description
Regex parses elements from a proper name in &lt;&lt;Last, First&gt;&gt; order and permutations. Comments and critiques are welcome.
Matches
Walker, David F | Smith, Jr., J. S. | DeCarlo, Yvonne
Non-Matches
peterson, oscar
Author Rating: Not yet rated. David Walker
Title Test Details ISBN-10
Expression
ISBN\x20(?=.{13}$)\d{1,5}([- ])\d{1,7}\1\d{1,6}\1(\d|X)$
Description
This RE validates the format of an ISBN number
Matches
ISBN 0 93028 923 4 | ISBN 1-56389-668-0 | ISBN 1-56389-016-X
Non-Matches
123456789X | ISBN 9-87654321-2 | ISBN 123 456-789X
Author Rating: Not yet rated. 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: Not yet rated. Bernard Martin-Rabaud
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{1,3}|St\.\s)?[A-Z]\w+\-?[A-Z]?\w*)(?:,\s|)(?<Suffix>Jr\.|Sr\.|IV|III|II|)
Description
Getting closer now... this one has the functionality of the previous two and matches on names like &quot;Jill St. John&quot; as well.
Matches
David F. Walker | Norm MacDonald | Jill St. John
Non-Matches
oscar peterson
Author Rating: Not yet rated. David Walker
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: Not yet rated. Eli Robillard
Title Test Details Pattern Title
Expression
^([\s\S]){1,20}([\s\.])
Description
This pattern returns as much of the first x characters of a string as full words or sentences as a match, where x is currently 20. Change x to adjust the length supported in your database field. I'm currently using this within a string shortening utility to shrink large text regions to word/sentance-boundary elements and appending an ellipsis as a text continuator.
Matches
Any text of any length | ...but will only 'match' the first 20 characters at a period or space.
Non-Matches
N/A
Author Rating: Not yet rated. Shawn Hall
Title Test Details Pattern Title
Expression
regex
Description
This pattern matches..
Matches
regex
Non-Matches
a
Author Rating: Not yet rated. Roy Osherove
Title Test Details Pattern Title
Expression
^ISBN\s(?=[-0-9xX ]{13}$)(?:[0-9]+[- ]){3}[0-9]*[xX0-9]$
Description
This pattern validates ISBN numbers. I've written a full description about it here: http://regexblogs.com/dneimke/posts/201.aspx
Matches
ISBN 90-70002-34-5 | ISBN 90-70002-34-x
Non-Matches
ISBN 90-70002-34-5x | ISBN 90-700-02-34-5
Author Rating: Not yet rated. Darren Neimke
Title Test Details Pattern Title
Expression
^(\d{4}-){3}\d{4}$|^(\d{4} ){3}\d{4}$|^\d{16}$
Description
Used to validate Credit Card numbers, Checks if it contains 16 numbers in groups of 4 separated by -, ,or nothing
Matches
1111-2323-2312-3434 | 1234343425262837 | 1111 2323 2312 3434
Non-Matches
1111 2323 2312-3434 | 34323423 | 1111-2323-23122-3434
Author Rating: Not yet rated. Sachin Bhatt
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
.*[Oo0][Ee][Mm].*
Description
Spam Stopper
Matches
OEM | 0em
Non-Matches
na
Author Rating: Not yet rated. Alanski Perryman
Title Test Details Pattern Title
Expression
^\d{3}\s?\d{3}\s?\d{3}$
Description
Social Insurance Number validator. Canadians only need apply. If somebody could help me (I'm bad at regex), I would like to modify this so that if there is one space after the 3rd digit (or 6th) then there must be one after the 6th (or third).
Matches
123 456 789 | 123456789 | 123 456789
Non-Matches
1234 5678 9 | 123 456 7890 | 123
Author Rating: Not yet rated. Matt Martens
Title Test Details Pattern Title
Expression
.*[\$Ss]pecia[l1]\W[Oo0]ffer.*
Description
Spam stopper
Matches
$pecia1 0ffer
Non-Matches
na
Author Rating: Not yet rated. Alanski Perryman
Title Test Details Pattern Title
Expression
(\d{6}[-\s]?\d{12})|(\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4})
Description
Credit card validator Works for switch card numbers too Switch card bit is (\d{6}[-\s]?\d{12}) Credit card bit is (\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}) I use this as a client side test before running a more comprehensive server side check.
Matches
5111 1111 1111 11118 | 1234123412341324 | 123456 123456789012
Non-Matches
511a 1111 1111 11118
Author Rating: Not yet rated. Joe Gass
Title Test Details Pattern Title
Expression
^(([a-h,A-H,j-n,J-N,p-z,P-Z,0-9]{9})([a-h,A-H,j-n,J-N,p,P,r-t,R-T,v-z,V-Z,0-9])([a-h,A-H,j-n,J-N,p-z,P-Z,0-9])(\d{6}))$
Description
Tests Vehicle Identification Numbers (VINs). This works for a Mitsubishi cars in the UK - but I have been unable to determine whether the format is for UK vehicles or applies only to this make. The requirements are that the first 9 characters and the 11th character are alpha-numeric excluding i, I, o or O. The 10th character is the chassis year, and is alpha-numeric excluding i, I, o, O, q, Q, u, and U. The final 6 characters are numeric. The string is 17 characters in length. Any refinements would be greatly appreciated!
Matches
abcDEFghp3t123456 | A1C3E5G6Y98123456 | A1C3E5G6FFF123456
Non-Matches
AIC3E5G6FFF123456 | A8C3E5G6FQF123456 | A8C3E5G6F9F12345H
Author Rating: Not yet rated. Edward Collier
Title Test Details Pattern Title
Expression
^[a-zA-Z]+(([\'\,\.\-][a-zA-Z])?[a-zA-Z]*)*$
Description
This allows you to validate first names and last names in seperate fields. Instead of validating a full name in one field.
Matches
Sameul | O'Conner | Mary-Kate
Non-Matches
David Bugel | Robert1 | Robert M. Larry
Author Rating: Not yet rated. Hayk A
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
^(?=.*\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
Change page:   |    Displaying page 3 of 5 pages; Items 41 to 60

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