while ("this_is_broken_" =~ /(.*?)_/gs) { print "($1) "; } #### ^C C:\>perl -mre=debug trash.pl Freeing REx: `,' Compiling REx `(.*?)_' size 10 first at 5 1: OPEN1(3) 3: MINMOD(4) 4: STAR(6) 5: SANY(0) 6: CLOSE1(8) 8: EXACT <_>(10) 10: END(0) floating `_' at 0..2147483647 (checking floating) anchored(SBOL) implicit minlen 1 Guessing start of match, REx `(.*?)_' against `this_is_broken_'... Found floating substr `_' at offset 4... Guessed: match at offset 0 Matching REx `(.*?)_' against `this_is_broken_' Setting an EVAL scope, savestack=9 0 <> | 1: OPEN1 0 <> | 3: MINMOD 0 <> | 4: STAR Setting an EVAL scope, savestack=9 0 <> | 6: CLOSE1 0 <> | 8: EXACT <_> failed... SANY can match 1 times out of 1... 1 | 6: CLOSE1 1 | 8: EXACT <_> failed... SANY can match 1 times out of 1... 2 | 6: CLOSE1 2 | 8: EXACT <_> failed... SANY can match 1 times out of 1... 3 | 6: CLOSE1 3 | 8: EXACT <_> failed... SANY can match 1 times out of 1... 4 <_is_brok> | 6: CLOSE1 4 <_is_brok> | 8: EXACT <_> 5 | 10: END Match successful! (this) Guessing start of match, REx `(.*?)_' against `is_broken_'... Found floating substr `_' at offset 2... Guessed: match at offset 0 Matching REx `(.*?)_' against `is_broken_' Setting an EVAL scope, savestack=9 5 | 1: OPEN1 5 | 3: MINMOD 5 | 4: STAR Setting an EVAL scope, savestack=9 5 | 6: CLOSE1 5 | 8: EXACT <_> failed... SANY can match 1 times out of 1... 6 | 6: CLOSE1 6 | 8: EXACT <_> failed... SANY can match 1 times out of 1... 7 <_broken> | 6: CLOSE1 7 <_broken> | 8: EXACT <_> 8 | 10: END Match successful! (is) Guessing start of match, REx `(.*?)_' against `broken_'... Found floating substr `_' at offset 6... Guessed: match at offset 0 Matching REx `(.*?)_' against `broken_' Setting an EVAL scope, savestack=9 8 | 1: OPEN1 8 | 3: MINMOD 8 | 4: STAR Setting an EVAL scope, savestack=9 8 | 6: CLOSE1 8 | 8: EXACT <_> failed... SANY can match 1 times out of 1... 9 | 6: CLOSE1 9 | 8: EXACT <_> failed... SANY can match 1 times out of 1... 10 | 6: CLOSE1 10 | 8: EXACT <_> failed... SANY can match 1 times out of 1... 11 | 6: CLOSE1 11 | 8: EXACT <_> failed... SANY can match 1 times out of 1... 12 | 6: CLOSE1 12 | 8: EXACT <_> failed... SANY can match 1 times out of 1... 13 | 6: CLOSE1 13 | 8: EXACT <_> failed... SANY can match 1 times out of 1... 14 <_> | 6: CLOSE1 14 <_> | 8: EXACT <_> 15 <> | 10: END Match successful! (broken) Freeing REx: `(.*?)_'