The OP wants to modify HTML using regex, which as we know is a task fraught with
danger. It appears he knows a little sed, but not enough to handle multi-line patterns or how to escape special characters like
&
. But he doesn't know Python or Perl, so his question isn't really a legitimate programming question for those tags.