[thelist] Function to strip HTML in ASP

Bob Davis bobd at members.evolt.org
Sun Jul 9 22:22:47 CDT 2000


on 07/09/2000 9:05 PM, Madhu Menon at madhu_news at postmark.net wrote:

> Fellow listees,
> 
> I was wondering if any of you kind folks could think of how to make a
> function in ASP to strip out all HTML from a web page and convert it
> to plain text. I have a wonderful utility called Notetab Pro that does
> an admirable job of this, but I must now do it programatically. My
> brain doesn't seem to be doing too good a job at 04:00 AM.
> 
> For brevity's sake, let's assume the web page has been loaded into a
> variable called strWebPage.
> 
> I appreciate any help you can provide.
> 

You could run it through a grep pattern that looks for:

<[^<]*>

and replaces with nothing.

This works fine in BBEdit (which also has a strip all tags function, but has
good regexp support).

I think you can use regular expressions in ASP (I know JavaScript will do
it, and you can write ASP in JavaScript).

Right?

I know - not a complete answer, but it's a start.

bob

-- 

bob davis
bobd at members.evolt.org





More information about the thelist mailing list