Strip HTML Tags

Is there an easy way to strip HTML tags?

I have a list box and I want to display a “snipped” of a block of text that is HTML to give the user a hint of what is in the formatted version for each row in the listbox.

[quote=125121:@Mark Strickland]Is there an easy way to strip HTML tags?

I have a list box and I want to display a “snipped” of a block of text that is HTML to give the user a hint of what is in the formatted version for each row in the listbox.[/quote]

Mac, Windows, Linux, Web ?

just loop through the input string.
If you see < then change a boolean like ignoreMode to true
If you see > then change a ignoreMode to false
If you see a different character and you’re not in ignoreMode then add it to the output String

This is a Web app. After a little digging it appears that maybe a RegEx can do it. I have not tried yet but here is what I found. It is essentially the same idea as Brock but with a RegEx.

Regex expression \<[^\>]*\>
Literal <
Any character that NOT in this class:[\>], any number of repetations
Literal >

We have RemoveHTMLTagsMBS plugin method for that.

1 Like

Kem has some very nice samples already created in his RegExRX app
One is definitely matching html tags

Well when I went to look up the syntax of the regex stuff in XOJO the example in help was to remove HTML tags. It works fine for what I need.

To borrow a Homer Simpson word: D’oh!

I think I added that. :slight_smile: