What Perl variables are used for the positions of the start and end of last successful regex match? [closed]
Question
What Perl variables are used for the positions of the start and end of last successful regex match?
La solution
As the perlvar
man-page explains:
$+[0]
is the offset into the string of the end of the entire [last successful] match. This is the same value as what thepos
function returns when called on the variable that was matched against.
$-[0]
is the offset of the start of the last successful match.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow