in reply to Add tag

It would help if you put the HTML tags you're talking about in <code>...</code> tags too so we don't have to guess.

See also: Add at the begining of text which seems to discuss similar things.

All in all I think that HTML manipulation via regexes is not a good idea - maybe you want to use a BBCode module like Parse::BBCode to achieve your end goal, whatever it is?

Perl 6 - links to (nearly) everything that is Perl 6.