Proxy Community
Best Way to Get All HTML Tags Regex? Need Help with a Reliable Pattern! - Printable Version

+- Proxy Community (https://proxycommunity.com/forum)
+-- Forum: Technical Community Support (https://proxycommunity.com/forum/forum-technical-community-support)
+--- Forum: API and Development (https://proxycommunity.com/forum/forum-api-and-development)
+--- Thread: Best Way to Get All HTML Tags Regex? Need Help with a Reliable Pattern! (/thread-best-way-to-get-all-html-tags-regex-need-help-with-a-reliable-pattern)

Pages: 1 2 3


“” - cloakSprint77 - 16-03-2025

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.