Skip to content

Instantly share code, notes, and snippets.

@javajosh
Created March 24, 2009 04:11
Show Gist options
  • Save javajosh/83931 to your computer and use it in GitHub Desktop.
Save javajosh/83931 to your computer and use it in GitHub Desktop.
String s = "<SCRIPT type=\"blah\" .....>xyz" +
"blah blah blah blah\n" +
"blah blah blah blah\n" +
"blah blah ...........\n" +
"</script>";
Pattern p = Pattern.compile("<script .*?(>.*?)</script>",
Pattern.DOTALL | Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher(s);
if (m.matches()) {
System.out.println("Found:\n" + m.group(1));
} else {
System.out.println("Nothing found :(");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment