You are viewing the version of this documentation from Perl 5.40.0. View the latest version
$<digits> ($1, $2, ...)

Contains the subpattern from the corresponding set of capturing parentheses from the last successful pattern match in the current dynamic scope. (See "Scoping Rules of Regex Variables".)

Note there is a distinction between a capture buffer which matches the empty string a capture buffer which is optional. Eg, (x?) and (x)? The latter may be undef, the former not.

These variables are read-only.

Mnemonic: like \digits.