I think you are after /^([01][0-9]|[2][0-3]):?([0-5][0-9])$/ Taco Fleur - Pacific Fox an industry leader with commercial IT experience since 1994 . http://www.pacificfox.com - Web Design and Development
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Andrew Scott > Sent: Tuesday, 27 September 2005 11:53 AM > To: CFAussie Mailing List > Subject: [cfaussie] JS Regular Expression > > > > Anyone help me debug this Expression. My regex is not crash hot. > > var IsTime = /^([01]?[0-9]|[2][0-3])(:[0-5][0-9])?$/.test(TimeValue); > > The above checks to see if a string is in the format hh:mm > but I would like it to be either hh:mm or hhmm. > > I can't seem to get it to work on the last condition, anyone > able to guide me here. > > > Regards > Andrew Scott > Analyst Programmer > > CMS Transport Systems > Level 2/33 Bank Street > South Melbourne, Victoria, 3205 > > Phone: 03 9699 7988 - Fax: 03 9699 7976 > > Quote: > To be, or what?- Sylvester Stallone > -------------------------------------------------------------- > -------------- > -------------------------- > > > > --- > You are currently subscribed to cfaussie as: > [EMAIL PROTECTED] To unsubscribe send a blank email > to [EMAIL PROTECTED] > Aussie Macromedia Developers: http://lists.daemon.com.au/ > --- You are currently subscribed to cfaussie as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/
