in reply to Parenthesis usage in Regular Expressions

a side effect of which is that they capture the value for backreferencing

Replies are listed 'Best First'.
Re: Re: Regular Expressions
by stefp (Vicar) on Jun 08, 2002 at 04:17 UTC
    If you want grouping without capturing, use (?:...) instead of the (...) pattern.

    In list context, you can get away with unwanted captures by using undef on the left hand side.

     my( $a, undef, $b) = m/(a)(b)(c)/;

    -- stefp -- check out TeXmacs wiki