How to print out html tags excluding the attributes

Chris Angelico rosuav at gmail.com
Sat Jul 20 21:13:25 EDT 2019


On Sun, Jul 21, 2019 at 11:06 AM sum abiut <suabiut at gmail.com> wrote:
>
> I want to use regular expression to print out the HTML tags excluding the
> attributes.

I'll just leave this here...

https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags

No, I won't be that cruel. I'll also suggest that Beautiful Soup is an
excellent non-regex way to parse HTML.

ChrisA



More information about the Python-list mailing list