DB<3> use re "debug"; print 'abcdc' =~ /(.).*\1/ Compiling REx "(.).*\1" Final program: 1: OPEN1 (3) 3: REG_ANY (4) 4: CLOSE1 (6) 6: STAR (8) 7: REG_ANY (0) 8: REF1 (10) 10: END (0) minlen 1 Matching REx "(.).*\1" against "abcdc" 0 <> | 0| 1:OPEN1(3) 0 <> | 0| 3:REG_ANY(4) 1 | 0| 4:CLOSE1(6) 1 | 0| 6:STAR(8) | 0| REG_ANY can match 4 times out of 2147483647... 5 <> | 1| 8:REF1: "a"(10) | 1| failed... 4 | 1| 8:REF1: "a"(10) | 1| failed... 3 | 1| 8:REF1: "a"(10) | 1| failed... 2 | 1| 8:REF1: "a"(10) | 1| failed... 1 | 1| 8:REF1: "a"(10) | 1| failed... | 0| failed... 1 | 0| 1:OPEN1(3) 1 | 0| 3:REG_ANY(4) 2 | 0| 4:CLOSE1(6) 2 | 0| 6:STAR(8) | 0| REG_ANY can match 3 times out of 2147483647... 5 <> | 1| 8:REF1: "b"(10) | 1| failed... 4 | 1| 8:REF1: "b"(10) | 1| failed... 3 | 1| 8:REF1: "b"(10) | 1| failed... 2 | 1| 8:REF1: "b"(10) | 1| failed... | 0| failed... 2 | 0| 1:OPEN1(3) 2 | 0| 3:REG_ANY(4) 3 | 0| 4:CLOSE1(6) 3 | 0| 6:STAR(8) | 0| REG_ANY can match 2 times out of 2147483647... 5 <> | 1| 8:REF1: "c"(10) | 1| failed... 4 | 1| 8:REF1: "c"(10) 5 <> | 1| 10:END(0) Match successful! cFreeing REx: "(.).*\1" DB<4>