Raphael Geissert <[email protected]> writes: > May I suggest moving that regex out of the for loop? it is faster to > apply a regex to a large string once than applying it to lots of small > strings. > > The following regex should do it: > $text =~ s/(?:[()[\]]|[.,;:?!]+(?=\s))//g;
I think we introduced this bug originally while trying to do this micro-optimization, and I'm not sure it's really worth it. But at the least, that regex doesn't work. It needs to handle sentences inside parentheses and the end of the string. Note that the picky check on description strings also uses a regex inside the loop. -- Russ Allbery ([email protected]) <http://www.eyrie.org/~eagle/> -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

