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 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
^[0-9]{1,}(,[0-9]+){0,}$
Description
It could be use to validate html input form (checkbox, optionbox, selectbox) when you have multiple numeric value under one field name. The validation is that the user have at lease chose one or more!
Matches
1111 | 47,26,2,1,1111,12 | 25,1245,2122,23232
Non-Matches
111, | 1a1,111,1212,23 | 11aa,aaa,asas,asa
Author Rating: Not yet rated. Nicholas Rathwell
Title Test Details Pattern Title
Expression
(\w+)\s+\1
Description
This expression uses a BackReference to find occurrences of the same word twice in a row (separated by a space). Matches things like 'mandate dated', which may not be desirable. See Sean Carley's update for a better expression for true repeated word matching.
Matches
hubba hubba | mandate dated | an annual
Non-Matches
may day | gogo | 1212
Author Rating: Not yet rated. Steven Smith
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 "-" or a " " 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 Any One US ASCII Letter
Expression
^[a-zA-Z]$
Description
Matches any single upper- or lower-case letter.
Matches
a | B | c
Non-Matches
0 | & | AbC
Author Rating: Not yet rated. Steven Smith
Title Test Details Pattern Title
Expression
foo
Description
The "hello world" of regular expressions, this will match any string with an instance of 'foo' in it.
Matches
foo
Non-Matches
bar
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
^([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 ‘,\*&$<> or other characters that could cause issues.
Matches
email@email.com | My Name | asdf12df
Non-Matches
‘,\*&$<> | 1001' string
Author Rating: Not yet rated. Paul Miller
Title Test Details Pattern Title
Expression
^([A-Z]{1}[a-z]{1,})$|^([A-Z]{1}[a-z]{1,}\040[A-Z]{1}[a-z]{1,})$|^([A-Z]{1}[a-z]{1,}\040[A-Z]{1}[a-z]{1,}\040[A-Z]{1}[a-z]{1,})$|^$
Description
Matches up to three alphabet words separated by spaces with first alphabet character of each word uppercase. Also matches empty strings.
Matches
Sacramento | San Francisco | San Luis Obispo
Non-Matches
SanFrancisco | SanLuisObispo | San francisco
Author Rating: Not yet rated. Don Batchelor
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
^((?:4\d{3})|(?:5[1-5]\d{2})|(?:6011)|(?:3[68]\d{2})|(?:30[012345]\d))[ -]?(\d{4})[ -]?(\d{4})[ -]?(\d{4}|3[4,7]\d{13})$
Description
This just a minor mod to Steven Smith's credit card re to accept spaces as separators, as well as return the four parts of the card. [Updated Oct-18-2002 to work with Diners Club/Carte Blanche (prefix must be 36, 38, or 300-305)]
Matches
6011567812345678 | 6011 5678 1234 5678 | 6011-5678-1234-5678
Non-Matches
1234567890123456
Author Rating: Not yet rated. Glenn Carr
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
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
.*[Pp]re[Ss\$]cr[iI1]pt.*
Description
Spam Stopper
Matches
Pre$criptions
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
.*[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
^(\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
^(([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
Change page:   |    Displaying page 4 of 5 pages; Items 61 to 80

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