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
(\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
(?<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
[\\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
([^\.\?\!]*)[\.\?\!]
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
^([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
^([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
(\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
(\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 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
Change page:   |    Displaying page 5 of 5 pages; Items 81 to 91

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