I\'m searching forward in an array of strings with a regex, like this:
for (int j = line; j < lines.length; j++) { if (lines[j] == null || lines[j].
If a previous match is something, that you have already matched going forward, then what about creating a list of matched positions while searching forward and then just use it to jump back instead of searching backward?