Regex is tricky for HTML, especially with nested tags. I’ve used `/<(\w+)[^>]*>(.*?)<\/\1>/g`, and it works for basic stuff, but it’s not perfect.
For self-closing tags, you might need to tweak it a bit. But honestly, just use an HTML parser. It’s way more reliable.
For self-closing tags, you might need to tweak it a bit. But honestly, just use an HTML parser. It’s way more reliable.
