regx for time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jain236
    New Member
    • Jul 2007
    • 36

    regx for time

    Hi i am trying to write regx for the time format HH:MM:SS in the below way

    /\d[0-24]:\d0[-60]:\d[0-59]/

    but i could not get the desired output,
    can some one throw some light why and where it is going wrong?

    Thanking you in advance
  • mohanprasadgutta
    New Member
    • Dec 2007
    • 33

    #2
    time regex

    Hi,

    are you trying achieve below regex?

    Code:
    /^[0-2][0-3]:[0-5][0-9]:[0-5][0-9]$/
    Best Regards,
    Mohan

    Comment

    Working...