in reply to regex grouping issue

Erm, [^(?:index\.cfm|browse)([\d\w]*)] doesn't mean what you think it means. You're conflating a complemented character class with negative lookahead; look in perlre for (?!).

Replies are listed 'Best First'.
Re^2: regex grouping issue
by nmerriweather (Friar) on Aug 31, 2006 at 19:21 UTC
    i totally forgot about negative lookaheads...

    that should cut down on a lot of my non-capturing parenthesis.

    thanks for the tip!
      The primary problem is that a character class is for characters, not sequences of characters. You can't use a character class to match any of a group of strings, and you can't use a negated character class to NOT match any of a group of strings.

      Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
      How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart