in reply to Perl regex

A) tr/// isn't what you want (even if you'd used a syntactically correct trailing slash). s/// is for substitutions.

B) unless you can guarantee a very strict formatting in the HTML you're operating on you don't want to use a regexp to manipulate HTML. Use HTML::TokeParser or HTML::TreeBuilder or the like.