Has anybody come across the following behavior...
When I run this code:
using Perl v5.8.0 (on Solaris), I get the following output:use Data::Dumper; my $re_bad = qr'@@([A-Z$#@_#]*) (?! [A-Za-z0-9$#@_] )'x; print Dumper $re_bad;
Notice the spurious characters at the end of the regex. Using Perl v5.6.1, the output is as expected:$VAR1 = qr/(?x-ism:@@([A-Z$#@_#]*) (?! [A-Za-z0-9$#@_] )$ )/;
The only reason I noticed this is that the regex I was actually using was such that the characters scribbled onto the end were **, resulting in an invalid regex. So, I can imagine that this error would go undetected for some time. NB The issue is not with Data::Dumper. I just used that to illustrate. It appears that Perl is actually writing extra characters onto the regex. Obviously, I will report the bug, but I wanted to see if anybody else had come across it. This will stop us migrating to 5.8.0 unless we can find an acceptable workaround.$VAR1 = qr/(?x-ism:@@([A-Z$#@_#]*) (?! [A-Za-z0-9$#@_] ))/;
Cheers, Kevin
In reply to Worrying regex issue with 5.8.0 by ruscoekm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |