in reply to Re^2: Pattern matching: Lazy vs. greedy
in thread Pattern matching: Lazy vs. greedy

The point of using /(?=(the .*? dog))/gi here is that look around assertions are zero length, i.e. after they match at position P, the next match is not searched at their end, but at the position P + 1, so you can find overlapping matches, as well.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^4: Pattern matching: Lazy vs. greedy
by false_friend (Novice) on Mar 30, 2015 at 17:47 UTC
    Thank you. Now I got it.