0

In Python Regular Expressions (re module), is there a character to exclude a certain character?

I am asking this, because I am trying to find a regular expression pattern, that removes everything between < and > in an html code without removing everything. Example:

<html>
<body>
</body>
<//html>

The pattern <.*> would remove everything as the < infront of html and the > behind /html would be recognized.

I don't want to type up all possible characters (basically all except < and >).

So I thought maybe there is some character which excludes a character. If this character was § for instance, maybe I could do something like <[.<§>§]*>.

Does a character like this exist?

Ron Lauterbach
  • 107
  • 1
  • 1
  • 12

0 Answers0