perl -le '$text = ; $T=time; for (1..$ARGV[0]) { my $TestText = $text; $TestText =~ s/\s+,\s+|\s+,|,\s+/,/g; } print time - $T; $T=time; $TestText=$text; for (1..$ARGV[0]) { my $TestText = $text; $TestText =~ s/\s*,\s*/,/g; } print time - $T;' 1000000