Created
April 30, 2015 03:06
-
-
Save stevez/b44d5fd4d0345fe19823 to your computer and use it in GitHub Desktop.
strip javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ScriptScrub { | |
def scrub(text) { | |
def regex = ~/(<script.*>)([\s\S]+)(<\/script>)/ | |
def result = text.replaceAll(regex, "") | |
result | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment