From: Mat Schaffer Date: 2006-07-24T03:32:41+09:00 Subject: Re: strip tags? On Jul 23, 2006, at 12:17 PM, Max Benjamin wrote: > Thanks for the quick replys. > I should have been more explicit in my question. I want to strip html > tags in order to sanitize form input. I'm a bit of a ruby noob and I > was hoping to find a function similar to PHP's strip_tags, one that > would remove both html and ruby code. > Best For sanitizing input, just escaping might be a better idea because it has less chance of being destructive. If you're on rails there's an h () function for this. If you're doing something else, maybe check out how rails does it and replicate it. There might be something easy that someone on this list knows that don't. If you really want to strip them, I'd bet the regexp solution is no less effective than PHP's strip_tags. -Mat