From: Daniel Baird Date: 2006-07-23T19:03:14+09:00 Subject: Re: strip tags? ------=_Part_51743_20873549.1153648991868 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/23/06, Andreas S. wrote: > > Daniel Baird wrote: > > On 7/23/06, Stefan Scholl wrote: > >> A regex isn't always the _best_ way to deal with markup > >> languages, but for an _easy_ way it's good enough. > > > > the problem is, it's not always the _correct_ way. > >
> > This is no correct HTML, < and > have to be encoded as entities. That is true.. if the original poster has the luxury of only dealing with correct html, he's a lucky fellow, and can kludge up some regexen that will do the job. Even in a well-coded site, it's not unthinkable that you could forget to do some encoding and end up with angle-brackets inside a textarea or something, though. How useful a regex approach is depends on the data. I have used a bit of regex-type html parsing before and it worked fine, for the data that I was parsing. Horses for courses. ;D -- Daniel Baird http://tiddlyspot.com (free, effortless TiddlyWiki hosting) http://danielbaird.com (TiddlyW;nks! :: Whiteboard Koala :: Blog :: Things That Suck) ------=_Part_51743_20873549.1153648991868--