Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
^(((((((0?[13578])|(1[02]))[\.\-/]?((0?[1-9])|([12]\d)|(3[01])))|(((0?[469])|(11))[\.\-/]?((0?[1-9])|([12]\d)|(30)))|((0?2)[\.\-/]?((0?[1-9])|(1\d)|(2[0-8]))))[\.\-/]?(((19)|(20))?([\d][\d]))))|((0?2)[\.\-/]?(29)[\.\-/]?(((19)|(20))?(([02468][048])|([13579][26])))))$
|
Description |
Simple American date format mm-dd-yyyy or mm-dd-yy, no time. Date range is 1900 --> 2099. Is enough for my purposes. Incorectly validates 02-29-1900. I created this to validate dates on a web form where the likely range will be 2000-->2020. Seperators can be '.','/' or '-'
Anyone know the rules for operator precedence for regex syntax?
|
Matches |
02-29-2004 | 1/31/1997 | 1-2-03
|
Non-Matches |
02-29-2003 | 04-31-2003 | 31-03-05
|
Author |
Rating:
Neil Walls
|
Displaying page
of
pages;
Items to