#reg.pl
$s = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxyyyRRRRyyyy\n" x 500;
$n = 0;
$n++ while ($s =~ /(.*?)RRRR\1/sg);
print "$n matches\n";
time ~/bin/perl5.8.0 reg.pl
500 matches
real 0m4.836s
user 0m4.800s
sys 0m0.010s
time ~/bin/perl5.6.1 reg.pl
0 matches
real 0m0.020s
user 0m0.020s
sys 0m0.000s
So, in fact, you are complaining that a bug got fixed. The problem is that these are extremely inefficient regular expressions because they involve a lot of backtracking. I recommend reading
Mastering Regular Expressions for a detailed explanation.