Looks like 5.6 is returning different results, regardless of platform.
What happens if you replace '\w+\W+' with \b (word boundary) ?
Regards,
Ian
To:
[EMAIL PROTECTED]
cc: (bcc: Ian Stewart/Great Lakes/AirTouch)
bcc: Ian Stewart/Great Lakes/AirTouch
Subject: Re: regexp matching more unpredictable in ActivePerl?
[IMAGE]
> No one has yet (at least as far as I've noticed) posted results using Perl
5.6 on UNIX.
I did in my second post. This isn't my second post but a smaller example:
---
use strict;
foreach (10, 20, 30, 40, 50) {
my $string = 'word ' x $_;
if ( $string =~ /((?:\w+\W+){0,25})$/ ) {
print "words: $_ length: ", length($1), "\n";
}
}
---
This is perl, version 5.005_03 built for MSWin32-x86-object
C:\temp>perl foo.pl
words: 10 length: 50
words: 20 length: 100
words: 30 length: 125
words: 40 length: 125
words: 50 length: 125
This is perl, v5.6.0 built for i386-openbsd
$ perl foo.pl
words: 10 length: 50
words: 20 length: 100
words: 30 length: 19
words: 40 length: 69
words: 50 length: 114
(Embedded image moved to file: pic22206.pcx)
pic22206.pcx