regexp character classes and +

Discussion in 'Ruby' started by Mark Volkmann, Aug 25, 2005.

  1. On page 71 of Pickaxe 2, discussing character classes, it says "The
    significance of special regular expression characters (including +) is
    turned off inside the brackets."

    Why is this a valid regular expression (+ not the first character in
    the character class)

    %r{^[-+*/]$}

    but this isn't? (+ is the first character in the character class)

    %r{^[+-*/]$}

    --=20
    R. Mark Volkmann
    Partner, Object Computing, Inc.
    Mark Volkmann, Aug 25, 2005
    #1
    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. basi
    Replies:
    1
    Views:
    105
    Austin Ziegler
    Aug 6, 2005
  2. Greg Hurrell
    Replies:
    4
    Views:
    150
    James Edward Gray II
    Feb 14, 2007
  3. Mikel Lindsaar
    Replies:
    0
    Views:
    464
    Mikel Lindsaar
    Mar 31, 2008
  4. Joao Silva
    Replies:
    16
    Views:
    340
    7stud --
    Aug 21, 2009
  5. Uldis  Bojars
    Replies:
    2
    Views:
    185
    Janwillem Borleffs
    Dec 17, 2006
Loading...

Share This Page