|
|
 |
RE: FN-FORUM: Function to strip out HTML from data
date posted 8th October 2007 17:45
Dom wrote:
> lynx?
Pretty overkill for a dynamically generated page?!
I'm guessing the best performance-accuracy will be clever use of reg =
exp, as
this is natively avail under most web scripting languages. I'd suggest =
one
of the following approaches (I'd investigate in the order given) if =
better
accuracy is needed, without the overhead of instantiating a third-party
component:
- two-pass reg exp; first to get rid of attribs, second to get rid of =
tags
- further refinement of the negative-lookahead approach
- replacement function; use something like (JS syntax):
sText.replace(//g, CheckTagMatch);
function CheckTagMatch($0) {
// verify is a correct tag match, poss iterative reg exp
call if necess.
// .. Write me ..
}
Cheers, Ben
--
Ben Johnson, Neogic Web Solutions
// design . development . managed hosting
w | http://www.neogic.com
t | +44 (0)1242 808 262
e | [EMAIL REMOVED]
|
 |
|