Heres what it would look like with bleadperl (future 5.10):

D:\dev\perl\ver\verbs\win32>..\perl -Mre=debug -e "'hello world' =~ /l +.w/" Compiling REx "l.w" Final program: 1: EXACT <l>(3) 3: REG_ANY(4) 4: EXACT <w>(6) 6: END(0) anchored "l" at 0 (checking anchored) minlen 3 Guessing start of match in sv for 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" 2 <he> <llo world> | 1:EXACT <l>(3) 3 <hel> <lo world> | 3:REG_ANY(4) 4 <hell> <o world> | 4:EXACT <w>(6) failed... 3 <hel> <lo world> | 1:EXACT <l>(3) 4 <hell> <o world> | 3:REG_ANY(4) 5 <hello> < world> | 4:EXACT <w>(6) failed... 9 <hello wor> <ld> | 1:EXACT <l>(3) 10 <hello worl> <d> | 3:REG_ANY(4) 11 <hello world> <> | 4:EXACT <w>(6) failed... Match failed Freeing REx: "l.w"

But this pattern is IMO not a particularly good example. It doesn't use very sophisticated constructs so it doesnt illustrate the potential breadth of what someone could want to know. Something with lots of alternations and different quantifiers and dynamic patterns would be a much better example.

---
$world=~s/war/peace/g


In reply to Re: alternate markup for the 're' pragma by demerphq
in thread alternate markup for the 're' pragma by szabgab

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.