How do I remove a span tag using a VBScript regex? For example, the following HTML should be reduced to just the h3 opening tag:
<h3><span style="color: inherit; font-size: 24px; line-height: 1.1;">
It must be by regex, as it is part of a regex process to standardize text. The content of the span can vary totally, and most of the time there is no span.
You should be able to use the pattern <span [^>]*> to match the opening tag (<span) and then grab everything up to the closing >.
Dim s
s = "<h3><span style=""color: inherit; font-size: 24px; line-height: 1.1;"">"
With New RegExp
.Pattern = "<span [^>]*>"
s = .Replace(s, "")
End With
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With