I have the following string:
<SEM>electric</SEM> cu <SEM>hello</SEM> rent <SEM>is<I>love</I>, <PARTITION />mind
I want to find the last "SEM" start tag before the "PARTITION" tag. not the SEM end tag but the start tag. The result should be:
<SEM>is <Im>love</Im>, <PARTITION />
I have tried this regular expression:
<SEM>[^<]*<PARTITION[ ]/>
but it only works if the final "SEM" and "PARTITION" tags do not have any other tag between them. Any ideas?