I want to limit the search between 2 words.
I have tried:
<Notes>(?:(?!<Notes>)[\s\S])*?sample(?:[\s\S\w]+)<\/Notes>(?:(?<![\s\S\w]<\/Notes>))*?
with options /gmU
For Text:
TextBefore<Notes>this is sample notes</Notes>TextWiths1ample<Notes>this is sample notes</Notes>
and Text:
TextBefore<Notes>this is sample notes</Notes>TextWithsample<Notes>this is sample notes</Notes>
The screenshot below will give you an idea of what I want to achieve: succesfull.
But the screenshot below shows that the regex is not limited between the 2 words: failed
Hope someone can help me (there is a reason why not to parse this as XML).
Saved regexp: https://regex101.com/r/0fhNxI/1