note
frozenwithjoy
<p>That's because it wasn't formatted correctly due to missing code tags (which were presumably left out so that the input text would be shown properly). When I first ran [moritz]'s code, I just got the original string, but when I substituted:</p>
<c>$str =~ s/[^\p{Latin}\s]//g;
</c>
<p>for this:</p>
<c>$str =~ s/^\p{Latin}\s//g;
</c>
<p>it worked.</p>
<p><i>EDIT: If you have lots of extra spaces in your output, you could run it through</i> <c>$str =~ s/ {2,}/ /g;</c><i>, too. Something to keep in mind is that [moritz]'s approach (as is) will remove punctuation.</i></p>
1005553
1005560