Remove script regular method in html code
/** * Remove script characters in the html code (<script ...>...</script> and <script ... /> * @author ob * */public class Regex {/** * @param args */public static void main(String[] args) {//Note that there is upper and lower case String s = "<script type='text/javascript'>aaaa</SCript>bbbbbbbbbb<SCRIPT type='text/javascript' />cccccc<SCRIPT type='text/javascript' >mm</SCRIPT>";s = s.replaceAll("(?i)(<SCRIPT)[//s//S]*?((</SCRIPT>)|(///S]*?((</SCRIPT>)|(///)", "");//Ignore case regular System.out.println(s);}}Running result: bbbbbbbbcccccc
The above article removes script regular methods from the html code are all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.