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 3
Title Test Details Pattern Title
Expression
^(0?[1-9]|1[012])$
Description
This will match numbers between 0 and 12. The 0? at the beginning will allow "01" as a valid match. This is useful for validation the month only component of a date part.
Matches
05 | 5 | 12
Non-Matches
0 | 1a | 13
Author Rating: Not yet rated. William Robertson
Title Test Details Pattern Title
Expression
^([12]?[0-9]|3[01])$
Description
This will match numbers in the range 1-31. This is useful for matching the day component of a datetime part.
Matches
1 | 20 | 31
Non-Matches
1a | 32 | 01
Author Rating: Not yet rated. William Robertson
Title Test Details Pattern Title
Expression
^((18[5-9][0-9])|((19|20)[0-9]{2})|(2100))$
Description
Will check to ensure the data is between 1850 and 2100.
Matches
1850 | 1977 | 2100
Non-Matches
1800 | a | 2101
Author Rating: Not yet rated. William Robertson
   Displaying page 1 of 1 pages; Items 1 to 3

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