use re 'Debug' => "EXECUTE"; say "xb" =~ /^(?(?!a) (?=bb)).b$/x ? "yes":"no"; # -> yes (wrong) say "xb" =~ /^(?(?!a) (?{}) (?=bb)).b$/x ? "yes":"no"; # -> no (correct) #### Guessing start of match in sv for REx "^(?(?!a) (?=bb)).b$" against "xb" Guessed: match at offset 0 Matching REx "^(?(?!a) (?=bb)).b$" against "xb" 0 <> | 1:BOL(2) 0 <> | 2:LOGICAL[1](3) 0 <> | 3:UNLESSM[0](9) 0 <> | 5: EXACT (7) failed... 0 <> | 9:IFTHEN(20) 0 <> | 11:IFMATCH[0](20) 0 <> | 13: EXACT (15) failed... 0 <> | 20:REG_ANY(21) <-- incorrectly continues here 1 | 21:EXACT (23) 2 <> | 23:EOL(24) 2 <> | 24:END(0) Match successful! yes Guessing start of match in sv for REx "^(?(?!a) (?{}) (?=bb)).b$" against "xb" Guessed: match at offset 0 Matching REx "^(?(?!a) (?{}) (?=bb)).b$" against "xb" 0 <> | 1:BOL(2) 0 <> | 2:LOGICAL[1](3) 0 <> | 3:UNLESSM[0](9) 0 <> | 5: EXACT (7) failed... 0 <> | 9:IFTHEN(22) 0 <> | 11:EVAL(13) 0 <> | 13:IFMATCH[0](22) 0 <> | 15: EXACT (17) failed... failed... Match failed no