I have a text and I need to take the content in a defined pattern. A content between MARK1 and MARK2 and content after MARK2. However, those marks can repeat and I need to take all their ocurrences. In the example below:
text: 'textA textB _MARK1_ textC _MARK2_ textD _MARK1_ textE textF _MARK2_ textG textH textI' array(0): _MARK1_ textC _MARK2_ textD array(1): textC array(2): textD array(3): _MARK1_ textE textF _MARK2_ textG textH textI array(4): textE textF array(5): textG textH textI
That would be:
At least, it works on RegEx Coach on your test case.
Of course, you need to iterate on each match.
Note it might not work on all flavors of regex: JavaScript, for example, has no lookahead assertions.