Hi everone! I need to parse an HTML file and i've got something like this:
<TAG1>
<TAG1>
TEXT_TO_FIND
KEY
<TAG1>
</TAG1>
<TAG1>
</TAG1>
</TAG1>
</TAG1>
Taking into account that there are multiple levels of anidation. How can I get the text TEXT_TO_FIND?
In plain english, what I need to do is to get the text between "the last that has the text KEY after it" and "the text KEY", which only appearse once on the document.
Note1: I found this question but it didn't seem to work; I kept getting an empty result. This would be the expression:
/<TAG1>(?!.*<TAG1>)(.*)KEY/ism
Note2: If I remove the KEY from the expression of the previous note, I get the text from the last to the end of file.
Thanks everyone in advance!