=over =item @LAST_MATCH_START =item @- X<@-> X<@LAST_MATCH_START> This array holds the offsets of the beginnings of the last successful match and any capture buffers it contains. (See L</Scoping Rules of Regex Variables>). The number of elements it contains will be one more than the number of the highest capture buffers (also called a subgroup) that actually matched something. (As opposed to C<@+> which may have more elements.) C<$-[0]> is the offset of the start of the last successful match. C<$-[I<n>]> is the offset of the start of the substring matched by I<n>-th subpattern, or undef if the subpattern did not match. Thus, after a match against C<$_>, C<$&> coincides with C<substr $_, $-[0], $+[0] - $-[0]>. Similarly, C<$I<n>> coincides with C<substr $_, $-[n], $+[n] - $-[n]> if C<$-[n]> is defined, and C<$+> coincides with C<substr $_, $-[$#-], $+[$#-] - $-[$#-]>. One can use C<$#-> to find the last matched subgroup in the last successful match. Contrast with C<$#+>, the number of subgroups in the regular expression. C<$-[0]> is the offset into the string of the beginning of the entire match. The I<n>th element of this array holds the offset of the I<n>th submatch, so C<$-[1]> is the offset where C<$1> begins, C<$-[2]> the offset where C<$2> begins, and so on. After a match against some variable C<$var>: =over 5 =item C<$`> is the same as C<substr($var, 0, $-[0])> =item C<$&> is the same as C<substr($var, $-[0], $+[0] - $-[0])> =item C<$'> is the same as C<substr($var, $+[0])> =item C<$1> is the same as C<substr($var, $-[1], $+[1] - $-[1])> =item C<$2> is the same as C<substr($var, $-[2], $+[2] - $-[2])> =item C<$3> is the same as C<substr($var, $-[3], $+[3] - $-[3])> =back This variable is read-only, and its value is dynamically scoped. This variable was added in Perl v5.6.0. =back