$ perl -Mre=debug -le " @F = q/yabba yobbo yebbe yubbu/ =~ /y(.)(.)\2\1/g " Compiling REx "y(.)(.)\2\1" Final program: 1: EXACT (3) 3: OPEN1 (5) 5: REG_ANY (6) 6: CLOSE1 (8) 8: OPEN2 (10) 10: REG_ANY (11) 11: CLOSE2 (13) 13: REF2 (15) 15: REF1 (17) 17: END (0) anchored "y" at 0 (checking anchored) minlen 3 Guessing start of match in sv for REx "y(.)(.)\2\1" against "yabba yobbo yebbe yubbu" Found anchored substr "y" at offset 0... Guessed: match at offset 0 Matching REx "y(.)(.)\2\1" against "yabba yobbo yebbe yubbu" 0 <> | 1:EXACT (3) 1 | 3:OPEN1(5) 1 | 5:REG_ANY(6) 2 | 6:CLOSE1(8) 2 | 8:OPEN2(10) 2 | 10:REG_ANY(11) 3 | 11:CLOSE2(13) 3 | 13:REF2(15) 4 | 15:REF1(17) 5 < yobbo yeb> | 17:END(0) Match successful! Guessing start of match in sv for REx "y(.)(.)\2\1" against " yobbo yebbe yubbu" Found anchored substr "y" at offset 1... Starting position does not contradict /^/m... Guessed: match at offset 1 Matching REx "y(.)(.)\2\1" against "yobbo yebbe yubbu" 6 | 1:EXACT (3) 7 | 3:OPEN1(5) 7 | 5:REG_ANY(6) 8 | 6:CLOSE1(8) 8 | 8:OPEN2(10) 8 | 10:REG_ANY(11) 9 | 11:CLOSE2(13) 9 | 13:REF2(15) 10 < yobb> | 15:REF1(17) 11 < yebbe yub> | 17:END(0) Match successful! Guessing start of match in sv for REx "y(.)(.)\2\1" against " yebbe yubbu" Found anchored substr "y" at offset 1... Starting position does not contradict /^/m... Guessed: match at offset 1 Matching REx "y(.)(.)\2\1" against "yebbe yubbu" 12 | 1:EXACT (3) 13 | 3:OPEN1(5) 13 | 5:REG_ANY(6) 14 | 6:CLOSE1(8) 14 | 8:OPEN2(10) 14 | 10:REG_ANY(11) 15 | 11:CLOSE2(13) 15 | 13:REF2(15) 16 < yebb> | 15:REF1(17) 17 < yebbe> < yubbu> | 17:END(0) Match successful! Guessing start of match in sv for REx "y(.)(.)\2\1" against " yubbu" Found anchored substr "y" at offset 1... Starting position does not contradict /^/m... Guessed: match at offset 1 Matching REx "y(.)(.)\2\1" against "yubbu" 18 < yebbe > | 1:EXACT (3) 19 < yebbe y> | 3:OPEN1(5) 19 < yebbe y> | 5:REG_ANY(6) 20 < yebbe yu> | 6:CLOSE1(8) 20 < yebbe yu> | 8:OPEN2(10) 20 < yebbe yu> | 10:REG_ANY(11) 21 < yebbe yub> | 11:CLOSE2(13) 21 < yebbe yub> | 13:REF2(15) 22 < yebbe yubb> | 15:REF1(17) 23 < yebbe yubbu> <> | 17:END(0) Match successful! Freeing REx: "y(.)(.)\2\1"