3 ms·
> As an added bonus it supports some Python and PCRE-specific extensions. This is a bit of a strange thing to say, since nearly all of the advanced regex featu
by theOnliest 13y ago
> As an added bonus it supports some Python and PCRE-specific extensions.
This is a bit of a strange thing to say, since nearly all of the advanced regex features showed up in Perl first. PCRE stands for "Perl-compliant regular expressions," so there's certainly no extensions there that didn't originally come from Perl. I'm less sure about Python, but I get the sense that they borrow from Perl regular expressions as well.
- peterwwillis 13y agohttp://perldoc.perl.org/perlre.html#PCRE/Python-Support http://perldoc.perl.org/perlre.html#PCRE/Python-Support PCRE/Python Support As of Perl 5.10.0, Perl supports several Python/PCRE-specific extensions to the regex syntax. While Perl programmers are encouraged to use the Perl-specific syntax, the following are also accepted: (?P<NAME>pattern) Define a named capture group. Equivalent to (?<NAME>pattern). (?P=NAME) Backreference to a named capture group. Equivalent to \g{NAME} . (?P>NAME) Subroutine call to a named capture group. Equivalent to (?&NAME).