will display debugging information about the matching process.perl -Mre=debug -e '"hello world" =~ /l.w/'
Is there a way to show the results in some other format (e.g. to include HTML markup?)
Update: output of the above call added
Freeing REx: `","' Compiling REx `l.w' size 6 Got 52 bytes for offset annotations. first at 1 1: EXACT <l>(3) 3: REG_ANY(4) 4: EXACT <w>(6) 6: END(0) anchored `l' at 0 (checking anchored) minlen 3 Offsets: [6] 1[1] 0[0] 2[1] 3[1] 0[0] 4[0] Guessing start of match, REx `l.w' against `hello world'... Found anchored substr `l' at offset 2... Starting position does not contradict /^/m... Guessed: match at offset 2 Matching REx `l.w' against `llo world' Setting an EVAL scope, savestack=3 2 <he> <llo world> | 1: EXACT <l> 3 <hel> <lo world> | 3: REG_ANY 4 <hell> <o world> | 4: EXACT <w> failed... Setting an EVAL scope, savestack=3 3 <hel> <lo world> | 1: EXACT <l> 4 <hell> <o world> | 3: REG_ANY 5 <hello> < world> | 4: EXACT <w> failed... Setting an EVAL scope, savestack=3 9 <hello wor> <ld> | 1: EXACT <l> 10 <hello worl> <d> | 3: REG_ANY 11 <hello world> <> | 4: EXACT <w> failed... Match failed Freeing REx: `"l.w"'
In reply to alternate markup for the 're' pragma by szabgab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |