You actually need an alternation operator with capturing group.
banaana|(apple)
The idea is, first banaana
would greedily match all the banaana strings. |
OR (apple)
capture apple
strings only from the remaining characters. So this won’t overlap with banaana strings.