The built-in variables @-
and @+
hold the start and end positions, respectively, of the last successful match. $-[0]
and $+[0]
correspond to entire pattern, while $-[N]
and $+[N]
correspond to the $N
($1
, $2
, etc.) submatches.
More Related Contents:
- string pattern matching using perl regex [closed]
- Awk – replace coumn 2 in table 1 from coumn 2 in table 2 based on matching data in column 1 (common between tables)
- I would like remove only spaces and ignore tabs in a string
- Match whitespace but not newlines
- The recognizing power of “modern” regexes
- Escaping a forward slash in a regular expression
- How can I use a variable in the replacement side of the Perl substitution operator?
- When is \G useful application in a regex?
- Why is a character class faster than alternation?
- What regex can match sequences of the same character?
- How to extract string following a pattern with grep, regex or perl [duplicate]
- Regex to match any character including new lines
- How do I handle special characters in a Perl regex?
- Why do ^ and $ not work as expected?
- How can I exclude some characters from a class?
- Can I use Perl regular expressions to match balanced text?
- What is the difference between \1 and $1 in a Perl regex?
- How do I perform a Perl substitution on a string while keeping the original?
- How can I use a variable for a regex pattern without interpreting meta characters?
- Does \w match all alphanumeric characters defined in the Unicode standard?
- How can I parse quoted CSV in Perl with a regex?
- How can I match double-quoted strings with escaped double-quote characters?
- Is There a Way to Match Any Unicode Alphabetic Character?
- How to escape dollar sign ($) in a string using perl regex
- Capturing text before and after a C-style code block with a Perl regular expression
- Can I substitute multiple items in a single regular expression in VIM or Perl?
- How do I search and replace across multiple lines with Perl?
- How to use different separators (/ , |) in a regular expression
- Counting number of occurrences of a string inside another (Perl)
- How to replace a string in an existing file in Perl