Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Parse ISO 8601 date/times

by roboticus (Chancellor)
on Nov 07, 2012 at 10:41 UTC ( #1002652=note: print w/ replies, xml ) Need Help??


in reply to Re: Parse ISO 8601 date/times
in thread Parse ISO 8601 date/times

grizzley:

I'm guessing he used [0-9] for visual symmetry with [0-2], [0-3], et. al. I was going to suggest that it would be easier to read, but when I converted a little bit from this:

&& $part !~ m{ # Time or partial time (or period): ^(?:|P)T [012][0-9] (?:| :?[0-5][0-9] (?:| :?[0-5][0-9] ) ) (?:| [.,][0-9]+ )$ }x

to this:

&& $part !~ m{ # Time or partial time (or period): ^(?:|P)T [012]\d (?:| :?[0-5]\d (?:| :?[0-5]\d ) ) (?:| [.,]\d+ )$ }x

I found that the better 'visual balance' of [0-9] was counterbalanced by the square brackets, which are a little too similar to vertical bars for my eyes. After looking at them both, I don't really have a preference--Perhaps if I had a better font...

...roboticus

When your only tool is a hammer, all problems look like your thumb.


Comment on Re^2: Parse ISO 8601 date/times
Select or Download Code
Re^3: Parse ISO 8601 date/times
by grizzley (Chaplain) on Nov 07, 2012 at 14:00 UTC
    I agree. [0-9] is visually better in this case.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2015-07-05 09:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (61 votes), past polls