So I have been trying to figure out regex to capture multiple sections of my data but, seems I've been failing since last two days now...:(
Please help Let's say following is my data :
<div class="tabs_container">
<ul class="tabs">
##BEGINLOOP##gAs##
<li><a href="#">##title##</a></li>
##ENDLOOP##
</ul>
##BEGINLOOP##LI##
<div class="tabs_content">##title## is ##content##</div>
##ENDLOOP##
</div>
and i want to capture following group:
- The text before ##BEGINLOOP##
- The text after ##BEGINLOOP## and before ##(gAs in first and LI in second)
- Text After ##ENDLOOP##
I have been trying various regex combination but nothing worked for giving me the exact solution. This was my last try
'/(?:##BEGINLOOP##)([a-z|A-Z]*)##(.+?)(?=##ENDLOOP##)(?:##ENDLOOP##)/s'
I am using PHP preg_match_all function
Please help ?