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
(?<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
(.)\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
^\d{9}[\d|X]$
Description
A very simple ISBN validation expression - it just checks for a 10 digit number where the last digit could also be a capital 'X'. Complete specs for ISBN available here: http://www.isbn.org/standards/home/isbn/international/html/usm4.htm. An enhancement would be to allow exactly 3 or 0 hyphens or 3 or 0 spaces, since these are also valid formats.
Matches
1234123412 | 123412341X
Non-Matches
not an isbn
Author Rating: Not yet rated. Steven Smith
Title Test Details Pattern Title
Expression
^\s*[a-zA-Z,\s]+\s*$
Description
Any Expression Upper/Lower Case, with commas and space between the text, with any amount of space before or after
Matches
Smith, Ed | Ed Smith | aBcDeFgH
Non-Matches
a123 | AB5 | Mr. Ed
Author Rating: Not yet rated. Mart Maasikas
Title Test Details Pattern Title
Expression
^(\d{4}[- ]){3}\d{4}|\d{16}$
Description
Credit card validator. Just checks that the format is either 16 numbers in groups of four separated by a &quot;-&quot; or a &quot; &quot; or nothing at all.
Matches
1234-1234-1234-1234 | 1234 1234 1234 1234 | 1234123412341234
Non-Matches
Visa | 1234 | 123-1234-12345
Author Rating: Not yet rated. Steven Smith
Title Test Details Pattern Title
Expression
^([1-zA-Z0-1@.\s]{1,255})$
Description
A general string validation to insure no malicious code is being passed through user input. General enough too allow email address, names, address, passwords, so on. Disallows ‘,\*&amp;$&lt;&gt; or other characters that could cause issues.
Matches
[email protected] | My Name | asdf12df
Non-Matches
‘,\*&amp;$&lt;&gt; | 1001' string
Author Rating: Not yet rated. Paul Miller
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
^((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 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
.*[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
.*[Vv][Ii1]agr.*
Description
Spam Stopper
Matches
V1agra
Non-Matches
na
Author Rating: Not yet rated. Alanski Perryman
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
.*\$AVE|\$ave.*
Description
Spam Stopper
Matches
$ave
Non-Matches
save
Author Rating: Not yet rated. Alanski Perryman
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
^(?:(?<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
^[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
.*[Pp]en[Ii1][\$s].*
Description
Spam Stopper
Matches
penis
Non-Matches
na
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
(\w(\s)?)+
Description
Used to verify that the string consists of only A-z, 0 - 9 and underscore. Several words allowed, only one space between them. No spaces up front. Hey, I know it's easy, but it was not in the library! Plus, the test option here is not working well all the time.
Matches
Test | TesT | tesT9 _test9
Non-Matches
\\\
Author Rating: Not yet rated. Alsu Fifty
Title Test Details Pattern Title
Expression
^(?!000)(?!666)(?<SSN3>[0-6]\d{2}|7(?:[0-6]\d|7[012]))([- ]?)(?!00)(?<SSN2>\d\d)\1(?!0000)(?<SSN4>\d{4})$
Description
Updated on 3/4/2004 per feedback to additionally exclude SSNs that begin with 666 which, as reported, are also not valid. Regular expression for validating US Social Security Numbers. Accepts optional hyphens or spaces as formatting characters. Parses the three subfields of the SSN into three named sub-strings (SSN1, SSN2, and SSN3) to facilitate program use. Rejects matches on all zeros for any individual subfield of the Social Security Number. Matches only on those SSNs that fall within the range of numbers currently allocated by the Social Security Administration.
Matches
111223333 | 111-22-3333 | 111 22 3333
Non-Matches
111003333 | 111 22-3333 | 666-22-3333
Author Rating: Not yet rated. Jerry Schmersahl
Change page:   |    Displaying page 3 of 5 pages; Items 41 to 60

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