Link to home
Start Free TrialLog in
Avatar of dnotestine
dnotestine

asked on

VB6 and MS Regular Expr - strip HTML

Using VB6 and MS Regular Expressions, I need to be able to strip out the HTML from a string, leaving just plain text that was located outside the HTML tags. Somewhere I saw a regular Expression to do this. What is the pattern and how do I do I do it in VB6? A simple code sample would be appreciated.
ASKER CERTIFIED SOLUTION
Avatar of zorvek (Kevin Jones)
zorvek (Kevin Jones)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
My example is not VB6 but it shows how RegExp works:

<script language="VBSCRIPT">

theString = "<b>Some</b>string<br>with<h1>Tags</h1>"

Set theExp = new RegExp

theExp.Pattern = "<[^>]+>"
theExp.Global = True

MsgBox theExp.Replace(theString, "")

</script>


Avatar of dnotestine
dnotestine

ASKER

Your Function worked perfectly in VB6. I just copied and pasted.