Home: Perl Programming Help: Regular Expressions:
(?P<..>..) in perl



gnix
Novice

Mar 5, 2009, 7:09 AM


Views: 10423
(?P<..>..) in perl

hi. I know that Python has the possibility to use this syntax (?P<name>regex) to have a backreference with the name 'name', instead of $1, $2, etc. I tryed in Perl, but it doesn't work. Do you know if is possible to use this syntax?

thanks
gnix


KevinR
Veteran


Mar 5, 2009, 1:43 PM


Views: 10419
Re: [gnix] (?P<..>..) in perl

It is but its new to perl 5.10 which is the newest major version of perl. See perlretut for details.

http://perldoc.perl.org/perlretut.html#Backreferences
-------------------------------------------------