I'm still fairly green when it comes to regular expressions. What I am trying to achieve is :
Source:
<!-- Text --><b>Text</b>
<a href="google.com">Link</a>
<div class="col"><h1>Nested Content</h1><p>More content</p>
</div>
<!-- END of Text -->
More text <!-- Another Tag Comment -->
Expected Capture :
$1 = Text
$2 = <b>Text</b>
<a href="google.com">Link</a>
<div class="col"><h1>Nested Content</h1><p>More content</p>
</div>
$3 = END of Text
Current Regex :
/\<\!-*( *[A-Za-z]*) *-*\>([\s\S\t\r]*)\<\!-*( *[A-Za-z]*) *-*\>/igm
The issues are its too greedy it continues until the match in the source ending with :
$3 = Another Tag Comment
How do I go about refactoring my regex to end with the expected capture ?