Why does:
$string =~ s/\^s//g;
$string =~ s/\s$//g;
$string =~ s/\s+$//g;
run faster than:
$string =~ s/\^s|\s$|\s+$/g;
on long strings?
you would think that because the second one is using a short circuit operator it would be faster because it only has to read through the string once instead of three times, but it is not.