On Tue Jun 24 00:45:27 2014, dietmar.schindler@manroland-web.com wrote: > This is a bug report for perl from dietmar.schindler@manroland- > web.com, > generated with the help of perlbug 1.40 running under perl 5.20.0. > > > ----------------------------------------------------------------- > I observed the following bug in Perl versions 5.10.1, 5.18.2 and > 5.20.0, while > versions 5.6.2 and 5.8.7 behaved correctly. > Regular expressions similar to /(?=.*P)P/ do not match certain text > which they > should match. Example: > " P" =~ /(?=.*P)P/ > yields no match, i. e. > print " P" =~ /(?=.*P)P/ > prints nothing instead of 1. > -------------------------------------------------------------- I don't believe this is a bug in Perl 5. According to 'perldoc perlre' in blead: "(?=pattern)" is used as "A zero-width positive look-ahead assertion." If we are to look ahead, we have to have something in the pattern *from which we are looking ahead*. I don't see anything like that in your pattern. Did you perhaps want a positive look-behind pattern "(?<=pattern)"? Thank you very much. Jim Keenan --- via perlbug: queue: perl5 status: new https://rt.perl.org/Ticket/Display.html?id=122171Thread Previous | Thread Next