I have the following html template as a string in JS:
Hello
<repeater>
<div class="row">
<div class="col col-33"><img src="{{col1}}" /></div>
<div class="col col-33">{{col2}}</div>
<div class="col col-33">{{col3}}</div>
</div>
</repeater>
World!
I would like to write some regex that will return the tag and it content (may be more then one repeater on the page) so the result would be something like this:
<repeater>
<div class="row">
<div class="col col-33"><img src="{{col1}}" /></div>
<div class="col col-33">{{col2}}</div>
<div class="col col-33">{{col3}}</div>
</div>
</repeater>
can't find any working example anywhere and can't figure it out. any help would be appreciated.
Thanks
EDIT
As suggested in an answer below - I tried this:
var myRe = new RegExp("<repeater>([\s\S]*?)<\/repeater>", "i");
var myArray = myRe.exec(html);
myArray returns null object.