in reply to Re^2: Double check for positions
in thread Double check for positions

I mean that your search pattern GCTTCTTGC only appears once in AGCTTCTTGCGCTTCTT. If you think it appears twice, you are mistaken.

The pos reset is needed in case there are overlapping pattern matches (which is what I've taken your question to be about, despite the sample data). In that case the pos marker needs to be backtracked to one place after the start of the last match to cope with that.

Replies are listed 'Best First'.
Re^4: Double check for positions
by bisimen (Acolyte) on Oct 18, 2017 at 13:35 UTC
    Oh yeah, I forgot to remove the one "GC" is my example input... sorry.
      plus add it in the end, as your search pattern ends in 'GC', too