Regex and HTML? Oof, that’s a tough combo. I’ve tried `/<(\w+)[^>]*>(.*?)<\/\1>/g` before, and it kinda works, but it struggles with self-closing tags like `<img />`.
If you’re serious about getting all HTML tags regex, maybe look into XPath or CSS selectors instead. They’re way more robust for this kind of thing.
If you’re serious about getting all HTML tags regex, maybe look into XPath or CSS selectors instead. They’re way more robust for this kind of thing.
