Sorry, but I don't get this. If I want to switch tags in the source HTML then I would use Find/replace in my IDE or text editor. If I want to do something interesting with HTML tags live in the client browser then I would probably use the jQuery resources.
Maybe this is just some sort of demo of regular expressions - in which case it is mis-posted to HN.