RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 9
Title Test Details Simple App Relative Path
Expression
^~/[0-9a-zA-Z_][0-9a-zA-Z/_-]*\.[0-9a-zA-Z_-]+$
Description
Matches the app relative path of a file. This will work for relative paths of URLs. Not very complicated but will work to do basic validation.
Matches
~/myPage.htm | ~/123._aBc2 | ~/Hello_World-Page.aspx
Non-Matches
mybadPage.htm | ~/.Not | ~/Very. | ~/Good
Author Rating: The rating for this expression. C. Brendan Enrick
Title Test Details Employer Identification Number (EIN)
Expression
^[1-9]\d?-\d{7}$
Description
Accepts valid EIN numbers. It could use a bit of tweaking because these are the current valid prefixes allowed. 1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 87, 88, 90, 91, 92, 93, 94, 95, 98, 99
Matches
55-5555555 | 1-2345678 | 99-9999999
Non-Matches
00-1111111 | my-einnumb | 5-55555
Author Rating: Not yet rated. C. Brendan Enrick
Title Test Details One upper-case US ASCII Letter
Expression
^[A-Z]$
Description
Matches one Upper-case US ASCII Letter.
Matches
A | B | Z
Non-Matches
a | 1 | AA
Author Rating: Not yet rated. C. Brendan Enrick
Title Test Details Software Version Number
Expression
^\d+\.\d\.\d[01]\d[0-3]\d\.[1-9]\d*$
Description
4 part version numbers
Matches
0.0.60829.1 | 100.3.60931.5 | 5.1.11219.7
Non-Matches
1.1.60849.1 | 0.20.10.60810 | 1.1.11219.0
Author Rating: Not yet rated. C. Brendan Enrick
Title Test Details Simple Currency
Expression
^\d+(\.\d{2})?$
Description
A Simple Currency Expression. It will validate the number portion only.
Matches
13.37 | 24 | 0.42
Non-Matches
.25 | 15.2 | 2.507
Author Rating: Not yet rated. C. Brendan Enrick
Title Test Details Letter Grade
Expression
^A-?|[BCD][+-]?|[SN]?F|W$
Description
This matches a standard set of plus minus letter grades. A A- B+ B B- C+ C C- D+ D D- F SF NF W (SF - Stopped Attending F) (NF - Never Attended F) (W - Withdraw)
Matches
A | C+ | SF
Non-Matches
A+ | F- | Z
Author Rating: Not yet rated. C. Brendan Enrick
Title Test Details Full Name
Expression
^([a-zA-Z]+[\'\,\.\-]?[a-zA-Z ]*)+[ ]([a-zA-Z]+[\'\,\.\-]?[a-zA-Z ]+)+$
Description
Requires a person's name including at least 2 parts. (first and last) Allows optional extra names. It allows plenty of initials as well as symbols in names. Restricts symbol usage quite a bit, but allows even names with 2 symbols. Requires last name to have at least 2 characters and cannot be an initial. Works well for filtering names on validation.
Matches
E.J. O'Malley | Jack O'Neil | Mary-Lou Elizabeth Jones
Non-Matches
Johnathan Michael S. | Prince | Teddy Has-a..Fake-Name
Author Rating: The rating for this expression. C. Brendan Enrick
Title Test Details URL File Name
Expression
(?<!/)/(\w+\.\w+)?$
Description
Gets the file name from a URL including the "/". If the URL ends in "/" the "/" is matched.
Matches
/index.htm | / | /default.aspx
Non-Matches
google.com | hi everybody | \myFile.txt
Author Rating: The rating for this expression. C. Brendan Enrick
   Displaying page 1 of 1 pages; Items 1 to 9

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