Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Quick Regex trouble

by Not_a_Number (Prior)
on Jul 16, 2013 at 21:47 UTC ( #1044664=note: print w/replies, xml ) Need Help??

in reply to Quick Regex trouble

kennethk++ is right. I'd just like to post a word of warning concerning this part of your regex:


Firstly, you don't need to escape the dot in a character class (but there's nothing stopping you from doing so...). More importantly, the sequence


(with or without the backslash) in a character class means "any character between '.' (dot) and ':' (colon) (inclusive)".

As it happens, the only things in the ASCII (or UTF, or whatever) table between these two characters are the forward slash and the digits 0-9 (the latter being included, of course, in [:alnum:]).

The point is, that if you want to put a literal hyphen in a character class, you should generally put it at the very beginning or the very end, or else escape it with a backslash.

Update: Typos (yawn)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2018-03-24 12:28 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (298 votes). Check out past polls.