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

20 Replies, 1227 Views

Yo, regex is tricky for HTML, especially with nested tags. I’ve had some success with `/<[^>]+>/g`, but it’s not foolproof. It’ll grab everything between `<` and `>`, so it might catch stuff you don’t want.

For nested tags, regex just isn’t the best tool. Maybe check out tools like Cheerio (for JS) or lxml (for Python). They’re way better for parsing HTML.

Messages In This Thread



Users browsing this thread: 1 Guest(s)