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 5 of 5 pages; Items 81 to 91
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 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 &gt; 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+)\x20{2,}(?=\S+)
Description
Trim Inside. This pattern can be used with a replace value of &quot;$1 &quot; 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
^([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
"[^"\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
^(?=.*\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
^([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 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
^([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 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
Change page:   |    Displaying page 5 of 5 pages; Items 81 to 91

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