Title |
Test
Find
Pattern Title
|
Expression |
^(\d{1,2})(\s?(H|h)?)(:([0-5]\d))?$ |
Description |
Validates hours and minutes. Allows for entry in the form of hours:minutes with optional minutes and optional hours indicator (H or h). |
Matches |
1h | 1:45 | 45 |
Non-Matches |
1a | 145 | 1:99 |
Author |
Rating:
Not yet rated.
Andrew Yeaman
|
Source |
|
Your Rating |
|
Title: Yes
Name: Andrew Yeaman
Date: 2/4/2004 5:35:13 PM
Comment:
Thanks Darren!
Title: Would it be better...
Name: Darren Neimke
Date: 2/4/2004 3:29:45 AM
Comment:
... if you coded it so that the "minutes" part of the time was restricted to a number between 00 and 59? Something like this maybe:
^(\d{1,2})(\s?(H|h)?)(:([0-5]\d))?$
This would accept something like:
99h:59
But fail against:
99h:99