For my own future reference, a hard fought Java regular
expression.
foo(.*?)(?=foo)
This will match all the characters after the first expresion foo,
up to but not including the second expression foo
The (.*?) has a lazy quantifier, and will only capture as much
as it has to, to make the whole expression match.
The (?=foo) is a non-capturing lookahead, which will not exclude
the next foo from being a valid anchor.
i.e. The bold text indicates each match.
foowibblefoowobblefoojelly on a platefoo