Created
October 24, 2014 11:59
-
-
Save varya/9c868c9bc9eb7910a9c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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