Jump to content

Multiple matches inside a match


lemmin

Recommended Posts

Suppose I had some input that looked something like this:

[Title1]
any random characters
<match1>
<match2>
maybe more random
<match3>
[/Title1]
[Title2]
any random characters
<match4>
<match5>
maybe more random
<match6>
[/Title2]
[Title3]
any random characters
<match7>
<match8>
maybe more random
<match9>
[/Title3]

 

If all "match" strings were matched by my regex, how could I only match the ones inside of a specific area, such as the "Title2" area. Do I need to extract that area first and then perform the regex?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/190293-multiple-matches-inside-a-match/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.