I need help :)) (who does not)

Discussion in 'Perl Misc' started by zero1979, Dec 15, 2006.

  1. zero1979

    zero1979 Guest

    I am beginner in perl programming and I am curious

    wah does it mean. it is regular expresion
    ^xyz_[A-Z0-9][^_]*$

    I know almost all symbols but I cannot find what [^_] mean in this
    context.

    Help please
     
    zero1979, Dec 15, 2006
    #1
    1. Advertising

  2. zero1979

    Paul Lalli Guest

    zero1979 wrote:
    > Subject: I need help :)) (who does not)


    Please put the subject of your post in the Subject of your post. This
    subject should have been something along the lines of "What does [^_]
    mean in a regexp?"

    > I am beginner in perl programming and I am curious
    >
    > wah does it mean. it is regular expresion
    > ^xyz_[A-Z0-9][^_]*$


    Start of string, x, y, z, underscore, any character from A through Z or
    0 through 9, 0 or more of any characters other than the underscore, end
    of string.

    > I know almost all symbols but I cannot find what [^_] mean in this
    > context.


    Brackets in a regexp delimit a character class. They match one of any
    character listed in the brackets (either directly listed, or as part of
    a range, like [A-Z0-9]. The ^ is a special character in a character
    class that means "anything NOT listed here". Therefore [^_] means
    "anything that's not an underscore".

    Paul Lalli
     
    Paul Lalli, Dec 15, 2006
    #2
    1. Advertising

  3. On 15 Dec 2006 02:36:54 -0800, "zero1979" <>
    wrote:

    >Subject: I need help :)) (who does not)


    Me too (who does not?)
    ^
    ^

    How 'bout putting the subject of your post in the Subject anyway?

    >wah does it mean. it is regular expresion
    >^xyz_[A-Z0-9][^_]*$
    >
    >I know almost all symbols but I cannot find what [^_] mean in this
    >context.


    Anything that is not '_'. See

    perldoc perlre


    Michele
    --
    {$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
    (($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
    ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
    256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
     
    Michele Dondi, Dec 15, 2006
    #3
  4. zero1979

    Ben Morrow Guest

    Quoth "Paul Lalli" <>:
    > Brackets in a regexp delimit a character class. They match one of any
    > character listed in the brackets (either directly listed, or as part of
    > a range, like [A-Z0-9]. The ^ is a special character in a character
    > class


    ....at the *start* of a character class...[0] Elsewhere it just means
    itself. '-' is similar: it only denotes a range if it's *not* at the
    beginning or end of the class.

    See perldoc perlre for the full details.

    > that means "anything NOT listed here". Therefore [^_] means
    > "anything that's not an underscore".


    Ben

    [0] While I am quite sure *you* know this, Paul, it seems worth making
    sure others aren't confused... :)

    --
    Outside of a dog, a book is a man's best friend.
    Inside of a dog, it's too dark to read.
    Groucho Marx
     
    Ben Morrow, Dec 15, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bill Johnson
    Replies:
    0
    Views:
    1,256
    Bill Johnson
    Jul 8, 2005
  2. Replies:
    0
    Views:
    3,014
  3. Lasse Vågsæther Karlsen
    Replies:
    1
    Views:
    1,078
    Lasse Vågsæther Karlsen
    Nov 27, 2007
  4. Phi!
    Replies:
    1
    Views:
    206
  5. Replies:
    4
    Views:
    107
    Jonas Raoni
    Feb 28, 2006
Loading...

Share This Page