Help with a regex search

Hi there, I have a requirement to search for the following variations and return an array. The preg_split function is perfect, however its the pattern I need help for. Basically, I will have a long strring with some html comments in there with a specific tag contained, eg:
<!-- <<[MYTAG]>> -->

However, as there may be other comments in there eg:

<!-- <<[MYTAG]>> This has some extra text -->
<!-- Some more text here <<[MYTAG]>> And more here.

However I need the whole comment to be the split point. The important bits are <!-- <<[MYTAG]>> -->

Any one got ideas on how I would go about that?
LVL 11
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

ddrudikConnect With a Mentor Commented:
if you don't have nested comments:

Open in new window

mrjoltcolaConnect With a Mentor Commented:
Something like this. I did not test it.


Tag name will be in $2
ddrudikConnect With a Mentor Commented:
if you want to match your specific tag within a non-nested comment.

Open in new window

All Courses

From novice to tech pro — start learning today.