Once you have divided up the block into phrases, would not a substitution be the most efficient way of stripping the unwanted bits?
s/[^\.!\,\:\)]++[\.!\,\:\)]//I haven't tested this, it is just a thought - i.e. greedy match non-target characters followed by a single target character, and replace it with nothing?
And if you haven't already thought of it Benchmark is good for comparing any alternate ways you can think of doing this. And if speed is really an issue Devel::NYTProf is pretty rock and roll for optimising code usage! HTH!
In reply to Re: Way to "trim" part of a phrase?
by BioLion
in thread Way to "trim" part of a phrase?
by ultranerds
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |