Regex for HTML is a rabbit hole, man. I’ve used `/<(\w+)[^>]*>(.*?)<\/\1>/g`, and it’s okay for basic tags, but it falls apart with nested stuff.
For self-closing tags, you might need to add something like `/<[^>]+\/>/g` to catch those. But honestly, just use an HTML parser. It’ll save you so much headache.
For self-closing tags, you might need to add something like `/<[^>]+\/>/g` to catch those. But honestly, just use an HTML parser. It’ll save you so much headache.
