http://www.perlmonks.org?node_id=11114097


in reply to Re^4: substitution in textual area of HTML file
in thread substitution in textual area of HTML file

Post a few edge cases of the data you're working with and I'll take a look later on.