If you have a limited range of accepted tags then the following will probably be your best bet. 1. find all of the tags you want to allow. 2. replace their brackets with some non-standard character (like a yen symbol). 3. remove all other tags that exist. 4. replace your yen with brackets again.
> Hello, > > I've got a form field in which I want to allow people to enter HTML tags > (formatted stories for the web), but only a limited set of them such as > heading, bold, and italic tags so that they don't mess up the overall > formatting of the page. > > What I'd like to do is automatically strip out any other HTML tag (or > JavaScript, CSS, DHTML, etc.) from the submission but leave the safe tags. > I'm thinking that using a regular expression string to do this would be the > way to go, however there is something to consider about that idea. The data > ends up in an NTEXT field in the SQL database which is capable of storing a > lot of data and I suspect people might be typing as much as a few pages of > text into this field. So I'm worried that a regular expression might take > too long to parse through all the entered text. > > Perhaps I'm missing something obvious here. Anyone have any suggestions? > > ---mark > > ======================================================== > Mark Warrick ([EMAIL PROTECTED]) > Founder, Fusioneers.com / CTO, ZapConnect.com > Phone: 714-547-5386 / 714-667-0203 / Efax: 801-730-7289 > http://www.warrick.net / http://www.fusioneers.com > http://www.zapconnect.com > ICQ: 125160 AIM: markwarric Yahoo: Serengeti > ======================================================== > > > ______________________________________________________________________ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

