in reply to reg-ex pattern with nesting parethesis

$1 and $2 refer to the first and second captures, respectively: in this case, $1 corresponds to the entire regex, while $2 refers to just the \d+.

What they'll actually contain depends on what's in $_, of course.

  • Comment on Re: reg-ex pattern with nesting parethesis

Replies are listed 'Best First'.
Re^2: reg-ex pattern with nesting parethesis
by marscld (Beadle) on Jun 11, 2014 at 09:22 UTC
    In this case, out most parenthesis would be matched first, then for nested ones. Thanks for clarification, AppleFritter.