Now I have this:
String s = "1<script type='text/javascript'>2</script>3<script type='text/javascript'>3</script>5";
Pattern pattern = Pattern.compile("<script.*</script>");
Matcher matcher = pattern.matcher(s);
while (matcher.find()) {
s = s.replace(matcher.group(), "");
}
System.out.println(s);
The result is
15
But I need
135
In PHP we have /U modificator, but what should I do in Java? I thought about sth like this, but it is incorrect:
Pattern pattern = Pattern.compile("<script[^(script)]*</script>");