in reply to Re^2: counting overlapping patterns
in thread counting overlapping patterns

But requires rewriting the pattern. Mine will work even if the pattern comes from a variable, or contains different possibilities for the first character ('/AA|BB/' becomes '/(?=AA|BB)/'). My approach was to try to do minimal tinkering with the original, but yeah, it's not as obvious what's actually going on.

Replies are listed 'Best First'.
Re^4: counting overlapping patterns
by ikegami (Patriarch) on Feb 18, 2005 at 23:39 UTC
    Good point.