a RegEx to find all HTML tags *not* matching a list
"R.Wieser" <[email protected]> Wed, 9 Aug 2023 12:02:03 +0200
| Newsgroups | alt.comp.lang.vbscript |
|---|---|
| Organization | A noiseless patient Spider |
| Message-ID | <[email protected]> |
Hello all,
I'm stuck. I've got a simple regex like this :
oRegExp.Pattern = "(<(div|span))"
Text = oRegExp.Replace(Text,"~{$1}~")
, which works ("~{" and "}~" are just delimitors for debugging purposes).
But now I would like to to find all html tags which are *not* either "div"
or "span", and can't seem to find a solution. I thought that simply adding
a "^" negate would work :
oRegExp.Pattern = "(<^(div|span))"
Alas, now /nothing/ matches anymore (but I'm not getting any errors). :-(
I've just spend an hour or so tryinging to google a solution, but can't get
them to work either. :-|
tl;dr:
How do I create a pattern that will match all html tags /but for/ the ones
provided ?
Ah, almost forgot to mention: its about VBScript as running on XP pro.
Regards,
Rudy Wieser