To match a digit between 0 and 59, or a *, you could use the following regular expression:Actually, that would fail on single digit entries between 0 and 5 - because the first (optional) part of the expression would match, and then there would be no 2nd digit to match the second (required) part (\d). For the sake of the exercise, I had a play around with it and the following seems to work (for 0-59):([012345]?\d)
(But I also echo your sentiments about not re-inventing the wheel)/^(?:[0-9*]|[12345]\d)$/
Cheers,
Darren :)
In reply to Re^2: simple pattern match ?
by McDarren
in thread simple pattern match ?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |