$ perl -Mre=debug -le " $_ = q[ro/sham/bo]; print m{/(.+?)$} " Compiling REx "/(.+?)$" Final program: 1: EXACT (3) 3: OPEN1 (5) 5: MINMOD (6) 6: PLUS (8) 7: REG_ANY (0) 8: CLOSE1 (10) 10: EOL (11) 11: END (0) anchored "/" at 0 floating ""$ at 2..2147483647 (checking anchored) minlen 2 Guessing start of match in sv for REx "/(.+?)$" against "ro/sham/bo" Found anchored substr "/" at offset 2... Found floating substr ""$ at offset 10... Starting position does not contradict /^/m... Guessed: match at offset 2 Matching REx "/(.+?)$" against "/sham/bo" 2 | 1:EXACT (3) 3 | 3:OPEN1(5) 3 | 5:MINMOD(6) 3 | 6:PLUS(8) REG_ANY can match 1 times out of 1... 4 | 8: CLOSE1(10) 4 | 10: EOL(11) failed... REG_ANY can match 1 times out of 1... 5 | 8: CLOSE1(10) 5 | 10: EOL(11) failed... REG_ANY can match 1 times out of 1... 6 | 8: CLOSE1(10) 6 | 10: EOL(11) failed... REG_ANY can match 1 times out of 1... 7 | 8: CLOSE1(10) 7 | 10: EOL(11) failed... REG_ANY can match 1 times out of 1... 8 | 8: CLOSE1(10) 8 | 10: EOL(11) failed... REG_ANY can match 1 times out of 1... 9 | 8: CLOSE1(10) 9 | 10: EOL(11) failed... REG_ANY can match 1 times out of 1... 10 <> | 8: CLOSE1(10) 10 <> | 10: EOL(11) 10 <> | 11: END(0) Match successful! sham/bo Freeing REx: "/(.+?)$"