in reply to Matching HTML Tags

There isn't much context inyour questions so I may be off base. Are you generating an HTML page, but you want your content to be escaped? If so, have a look at URI::Escape. It esacped all non safe characters. You'll need to escape your content before generating the HTML, of course, or your tags will be escaped too.