perl -Mre=debug -e '$_ = q!(b).!; /\((?=a|b|c)\)/ && do { print qq{match! $&\n}; };' perl -Mre=debug -e '$_ = q!(b).!; /\((?=a|b|c)/ && do { print qq{match! $&\n}; };' #### $ perl -Mre=debug -e '$_ = q!(b).!; /\((?=a|b|c)\)/ && do { print qq{match! $&\n}; };' Compiling REx "\((?=a|b|c)\)" Final program: 1: EXACT <(> (3) 3: IFMATCH[0] (16) 5: TRIE-EXACT[abc] (14) 14: SUCCEED (0) 15: TAIL (16) 16: EXACT <)> (18) 18: END (0) anchored "()" at 0 (checking anchored) minlen 2 Guessing start of match in sv for REx "\((?=a|b|c)\)" against "(b)." Did not find anchored substr "()"... Match rejected by optimizer Freeing REx: "\((?=a|b|c)\)" $ perl -Mre=debug -e '$_ = q!(b).!; /\((?=a|b|c)/ && do { print qq{match! $&\n}; };' Compiling REx "\((?=a|b|c)" Final program: 1: EXACT <(> (3) 3: IFMATCH[0] (16) 5: TRIE-EXACT[abc] (14) 14: SUCCEED (0) 15: TAIL (16) 16: END (0) anchored "(" at 0 (checking anchored) minlen 1 Guessing start of match in sv for REx "\((?=a|b|c)" against "(b)." Found anchored substr "(" at offset 0... Guessed: match at offset 0 Matching REx "\((?=a|b|c)" against "(b)." 0 <> <(b).> | 1:EXACT <(>(3) 1 <(> | 3:IFMATCH[0](16) 1 <(> | 5: TRIE-EXACT[abc](14) 1 <(> | State: 1 Accepted: 0 Charid: 2 CP: 62 After State: 3 2 <(b> <).> | State: 3 Accepted: 1 Charid: 2 CP: 0 After State: 0 got 1 possible matches only one match left: #2 2 <(b> <).> | 14: SUCCEED(0) subpattern success... 1 <(> | 16:END(0) Match successful! match! ( Freeing REx: "\((?=a|b|c)"