I'm trying to validate that the proper format has been used to enter a 24 hour time. I'll admit I'm not a regex expert, but I thought the following would work. Actually, I got it from a regex expert friend, so I'm just assuming it should work.

<constant>
<constant-name>time</constant-name>
<constant-value>((?:0?[0-9]|1[0-9]|2[0-3]):[0-5][0-9])</constant-value>
</constant>


However, this seems to allow alpha-numerics (i.e. 2:00p or 2:00x), when I only want digits in the first two places, followed by a colon, followed by two more digits. 24:59. If course, it'd be nice if users could enter 1:24 too, but that's not a requirement.

Thanks,

Matt



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to