Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Re: Re: Sorting Issues :(

by Hofmator (Curate)
on Jul 18, 2001 at 22:04 UTC ( #97803=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Sorting Issues :(
in thread Sorting Issues :(

To be on the safe side it's probably best to allow whitespaces (or none) in some more places which would turn the regex into: $time =~ /^\s*(\d{1,2})\s*:\s*(\d\d)\s*([APM]{2})\s*$/
The \s* matches zero or more whitespaces and as many as possible (greedy). So this allows for any of the following (_ equals whitespace):

_12:00_AM__ 1_:_00_PM 2:20AM
And then you could allow for leaving out of AM/PM and assuming a 24 hour clock .... but /me gets carried away ;)

-- Hofmator

Replies are listed 'Best First'.
Re: Re: Re: Re: Sorting Issues :(
by LostS (Friar) on Jul 18, 2001 at 22:24 UTC
    All these suggestions rock... I work for a governent agency so... anyway to idiot proof the stuff helps :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://97803]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2018-09-19 20:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Eventually, "covfefe" will come to mean:













    Results (170 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!