in reply to Re: simple pattern match ?
in thread simple pattern match ?
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 :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: simple pattern match ?
by johngg (Canon) on Mar 15, 2006 at 19:07 UTC | |
|
Re^3: simple pattern match ?
by Corion (Patriarch) on Mar 15, 2006 at 16:50 UTC | |
by McDarren (Abbot) on Mar 15, 2006 at 17:12 UTC | |
by Corion (Patriarch) on Mar 15, 2006 at 17:15 UTC |