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

20 Replies, 1216 Views

Honestly, regex isn’t the best for HTML. It’s like using a hammer for a job that needs a screwdriver. I’d suggest using a library like BeautifulSoup or jsdom.

But if you’re set on regex, try `/<[^>]+>/g`. It’s simple and works for most cases, but don’t expect it to handle every edge case.

Messages In This Thread



Users browsing this thread: 1 Guest(s)