Skip to content

Instantly share code, notes, and snippets.

@tomraithel
Created November 16, 2012 08:23
Show Gist options
  • Save tomraithel/4085430 to your computer and use it in GitHub Desktop.
Save tomraithel/4085430 to your computer and use it in GitHub Desktop.
JS: Multiline RegEx to cut out body contents
// .* does not work because it can not handle multi line
var regex = /<body.*?>([\s\S]*)<\/body>/igm;
regex.exec(data);
data = RegExp.$1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment