- resIndex = regex.matchedFrom();
-
- if ((selection != null && selection.getSize() > 0) && (resIndex
- + spaces.get(resIndex) < selection.getStartRes()))
- {
- continue;
- }
- // if invalid string used, then regex has no matched to/from
- int sres = seq.findPosition(resIndex + spaces.get(resIndex));
- int eres = seq.findPosition(regex.matchedTo() - 1
- + (spaces.get(regex.matchedTo() - 1)));
- // only add result if not contained in previous result
- if (lastm == null || (lastm.getSequence() != seq
- || (!(lastm.getStart() <= sres
- && lastm.getEnd() >= eres))))
- {
- lastm = searchResults.addResult(seq, sres, eres);
- }
- hasResults = true;
- if (!findAll)
- {
- // thats enough, break and display the result
- found = true;
- resIndex++;
-
- break;
- }
-
- r = resIndex;