Hi
I'm trying to match a certain set of tags in a template file. I however want the tags to be able to be nested in itself.
My regex is the following: (with /s)
<!-- START (.*?) -->(.*?)<!-- END \\1 -->
Tag example:
<!-- START yList -->
y:{yList:NUM} |
<!-- START xList -->
x:{xList:NUM}
<!-- END xList -->
<!-- CARET xList -->
<br>
<!-- END yList -->
<!-- CARET yList -->
Right now the matches result will be:
match 0:
group(0) (Whole match)
<!-- START yList -->
y
<!-- START xList -->
x
<!-- END xList -->
<!-- CARET xList -->
<br>
<!-- END yList -->
group(1)
yList
group(2)
y
<!-- START xList -->
x
<!-- END xList -->
<!-- CARET xList -->
<br>
I want 2 matches instead of 1 obviously, the nested tag set isn't matched. Is this possible with regex, or should I just keep regexing group(2) results, untill i've found no new matches?