develooper Front page | perl.perl5.porters | Postings from May 2008

[PATCH] Todo test for [perl #38133] (was: [regex] backref problem with quantified groups)

From:
Bram via RT
Date:
May 25, 2008 02:23
Subject:
[PATCH] Todo test for [perl #38133] (was: [regex] backref problem with quantified groups)
Message ID:
rt-3.6.HEAD-11257-1211664223-268.38133-14-0@perl.org
Attached is a patch with a todo test for this bug report.

Summary of the report:

#!/usr/bin/perl -l

if ("A" =~ /(((?:A))?)+/) {
  print "\$1 = $1, \$2 = $2, \$3 = $3"
}

if ("A" =~ /(((A))?)+/) {
  print "\$1 = $1, \$2 = $2, \$3 = $3";
}
__END__
Output:

$1 = , $2 = , $3 =
$1 = , $2 = A, $3 = A


The value of the second capture group depends on wheter or not there is a 
third capturing group.

The value should be the same in both cases.

(For more info look at RT)




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About