in reply to Re^3: regex testing for multiple values
in thread regex testing for multiple values

"Mismatched" is so hard to understand?

Did you try taking it out?

{...} surrounds quantifiers in regexen, like:

=~/[A-Z](1,3}/ # Match any char in the range A-Z no fewer than once, # nor more than 3 times

Replies are listed 'Best First'.
Re^5: regex testing for multiple values
by Not_a_Number (Prior) on Mar 10, 2008 at 19:19 UTC
    Did you try it out?

    Did you? :)

    $_ = '{IND'; print "Ok\n" if /{IND/; ____ Ok

    Update: It seems that I misquoted ww, who actually wrote 'Did you try taking it out?'. My point remains valid, though. The problem is not with the regex, it is somewhere else in the code.

      With chagrin, I must admit that I was thinking syntax, and testing proves me wrong on that account.

      However, grashoper is not looking for '{IND' but, rather, for "3 letter account codes...."

      If I understand that correctly, the condition in the regex in Re^2: regex testing for multiple values

      if ($Session->{'usrSystem'}=~/{IND|NOR|PRO|ARM|SND/s)

      introduces an open_curly_brace ({), which is wrong, in part, because the regex then tries first to match on for an open_curly_brace.