Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Redundant regex ([0-9]{2} | [0-9] {2, 4})?

by ikegami (Patriarch)
on Feb 26, 2009 at 22:42 UTC ( #746694=note: print w/replies, xml ) Need Help??


in reply to Redundant regex ([0-9]{2} | [0-9] {2, 4})?

No, /[0-9]{2} / does not match a subset of what / [0-9] {2, 4}/ matches.

/[0-9]{2} / only matches "99\x{20}", where 9 can by any digit 0-9
/ [0-9] {2, 4}/ only matches "\x{20}9\x{20}{2,\x{20}4}", where 9 can by any digit 0-9

Update: Fixed copy and paste bug in in second item.

Replies are listed 'Best First'.
Re^2: Redundant regex ([0-9]{2} | [0-9] {2, 4})?
by Popcorn Dave (Abbot) on Feb 27, 2009 at 00:34 UTC
    Holy crap, I need glasses! I completely missed the space in there and didn't realize it until I increased the font size.

    That makes perfect sense now. Duh.


    To disagree, one doesn't have to be disagreeable - Barry Goldwater

      Spaces removed, /[0-9]{2}/ does match a subset of what /[0-9]{2,4}/ matches.

      I'm sure what he wanted was just /[0-9]{2,4}/.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2022-01-20 06:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (56 votes). Check out past polls.

    Notices?