Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: regular expression for "time-of-day" is not working

by DrHyde (Prior)
on Apr 05, 2012 at 09:58 UTC ( #963635=note: print w/replies, xml ) Need Help??


in reply to regular expression for "time-of-day" is not working

It's got other problems too. It won't match "09:02" or "23:02" or "00:02". You probably want something like this ...
/\b ( ( ([01][0-9]|2[0123]):[0-5][0-9] ) |( (1[012]|[1-9] ):[0-5][0-9]\s+[ap]m ) ) \b/ix

Replies are listed 'Best First'.
Re^2: regular expression for "time-of-day" is not working
by vjvalor (Initiate) on Apr 05, 2012 at 12:02 UTC
    Thanks you DrHyde. I was interested in 12-hour time format with no preceding 0.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://963635]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2017-07-27 08:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (405 votes). Check out past polls.