|Keep It Simple, Stupid|
Regex: Strip <script> tags?by Spidy (Chaplain)
|on Mar 21, 2007 at 15:24 UTC||Need Help??|
Spidy has asked for the
wisdom of the Perl Monks concerning the following question:
I am working on a project that allows users to input their own profile text, using any HTML markup they choose. CSS styles and HTML are all welcome; <script> tags are not. I am looking for a regex that will strip out the <script> tags for me.
I happened to find a solution given by someone named ender, which goes as follows:
However, I am unsure of how I would modify that regex to have it catch '<script ' at the beginning of the script(because it is common for there to be a space following the word 'script' with attributes). Does anyone know of what I would need to change?