2 ms·
How to replace HTML tags using regular expressions
- switz 15y agoIt feels very unnatural using regex to traverse HTML, however this seems like a somewhat decent solution. I doubt I'll be using it anytime soon, though.
- bdfh42 15y agoSorry, 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.