in reply to global regex

but the /g shouldn't make it match the whole string instead stopping after find the first ?

Replies are listed 'Best First'.
Re^2: global regex
by ikegami (Patriarch) on Jul 08, 2009 at 14:11 UTC

    Depends on context, but yes in this case (assuming your code is simply missing a ";").

    It, however, does not affect what gets put in $1, $2, etc. The earliest set of parens goes in $1, the next earliest set of parens goes in $2, etc. Since you only have one set of parens, only $1 will ever get populated.