IT

str = str.replaceAll("(?i)<script[^>]*>[\\w|\\t|\\r|\\W]*</script>" , "");
str = str.replaceAll("(?i)<head[^>]*>[\\w|\\t|\\r|\\W]*</head>" , "");
str = str.replaceAll("<", "&lt;");
str = str.replaceAll(">", "&gt;");
str = str.replaceAll("'", "\"");
str = str.replaceAll("\"", "&quot;");

Posted by sinpk