Skip to content

Instantly share code, notes, and snippets.

@varya
Created October 24, 2014 11:59
Show Gist options
  • Save varya/9c868c9bc9eb7910a9c3 to your computer and use it in GitHub Desktop.
Save varya/9c868c9bc9eb7910a9c3 to your computer and use it in GitHub Desktop.
/*
html:
<sg:wrapper>
<div class="wrapper" style="background: red; padding: 0.5em;">
<sg-wrapper-content/>
</div>
</sg:wrapper>
*/
var re = /<sg\:wrapper>([\s\S]*?)<\/sg\:wrapper>/g,
match = html.match(re);
console.log(match);
/* Output:
[ '<sg:wrapper>\n<div class="wrapper" style="background: red; padding: 0.5em;">\n <sg-wrapper-content/>\n</div>\n</sg:wrapper>' ]
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment