The text matched by the highest used capture group of the last successful search pattern. (See"Scoping Rules of Regex Variables"). It is logically equivalent to the highest numbered capture variable ($1
,$2
, ...) which has a defined value.
This is useful if you don't know which one of a set of alternative patterns matched. For example:
/Version: (.*)|Revision: (.*)/ && ($rev = $+);
This variable is read-only, and its value is dynamically scoped.
Mnemonic: be positive and forward looking.
Perldoc Browser is maintained by Dan Book (DBOOK). Please contact him via theGitHub issue tracker oremail regarding any issues with the site itself, search, or rendering of documentation.
The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via thePerl issue tracker, themailing list, orIRC to report any issues with the contents or format of the documentation.