in reply to Re: Anything else is fine!
in thread Anything else is fine!

You are missing: at least ba, ca, da (at least according to my by-hand count). You need the zero-lookahead on the following character to keep the regexp engine from gobbling up the second character.

Update: This could also be a parsing error of the OP on my part. This could also be the intent of the OP. Would the Anonymous Monk care to elaborate?

It is said that "only perl can parse Perl." I don't even come close until my 3rd cup of coffee. --MidLifeXis

Replies are listed 'Best First'.
Re^3: Anything else is fine!
by AnomalousMonk (Archbishop) on Feb 08, 2010 at 20:17 UTC

    BrowserUk's regex is easily modified to provide overlapping matches:

    >perl -wMstrict -le "my $s = 'aaabacadaabbbccccd'; print qq{'$1'} while $s =~ m[ (?= ((.) (?! \2) . ) ) ]xmsg;; " 'ab' 'ba' 'ac' 'ca' 'ad' 'da' 'ab' 'bc' 'cd'