Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Order of terms in square braces

by imp (Priest)
on Feb 03, 2007 at 00:44 UTC ( #598034=note: print w/replies, xml ) Need Help??

in reply to Order of terms in square braces

Because dashes in character classes are used to express ranges, like [a-z], except when they are the first item. Because of this you should always either put them as the first item, or escape them with \

Replies are listed 'Best First'.
Re^2: Order of terms in square braces
by TOD (Friar) on Feb 03, 2007 at 05:10 UTC
    first or last element in the class.

      or following a POSIX class
      or preceeding a POSIX class
      or following ^ if the ^ is the first character

      Basically, anywhere it doesn't make sense to treat it as a range seperator.

      Escaping - (like the OP needlessly did for ( and )) will force it to match literally.

Re^2: Order of terms in square braces
by throop (Chaplain) on Feb 05, 2007 at 19:37 UTC

    I should have known that. Thanks.


    The people are bright and certain, Where I am dim and confused; The people are clever and wise, Where I am dull and ignorant,

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://598034]
[Corion]: Meh. I'm reviving some old code, and it seems it used a module DBIx::Loader, but it doesn't exist on CPAN, and I can't even remember writing such a module... Maybe parts of it live on in DBIx::RunSQL, but not the parts I need right now :)

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2018-06-24 08:24 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.