Home Perl Regex

Special Variables


$` Text before match
$& Text matched
$' Text after match
$1 Text matched within 1st set of parentheses
$2 Text matched within 2nd set of parentheses
$+ Text from highest-numbered $1, $2, etc.
$^N Text from most recently closed $1, $2, etc.
@- Array of match-start indices into target text
@+ Array of match-end indices into target text
$^R Most recently executed embedded-code sonstruct