Best Way to Get All HTML Tags Regex? Need Help with a Reliable Pattern!

20 Replies, 1199 Views

Regex for HTML is a nightmare, honestly. I’ve tried `/<[^>]+>/g`, and it’s okay for simple cases, but it’s not great for nested tags or self-closing ones.

If you’re serious about this, I’d recommend using a proper HTML parser. Regex just isn’t built for this kind of thing.

Messages In This Thread



Users browsing this thread: 1 Guest(s)