S
Steveo
I am currently stripping HTML from a string with the following code.
(I know it's not the best way to strip HTML but bear with me)
re.compile("<.*?>")
I wanted to allow all H1 and H2 tags so i changed it to:
re.compile("<[^H1|^H2]*?>")
This seemed to work but it also allowed the HTML tag(basically anythin
with an H or a 1 or a 2) How can I get this to strip all tags except
H1 and H2. Any Help you could give would be great.
Steve
(I know it's not the best way to strip HTML but bear with me)
re.compile("<.*?>")
I wanted to allow all H1 and H2 tags so i changed it to:
re.compile("<[^H1|^H2]*?>")
This seemed to work but it also allowed the HTML tag(basically anythin
with an H or a 1 or a 2) How can I get this to strip all tags except
H1 and H2. Any Help you could give would be great.
Steve