Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

it seems to me specifically to be saying that you can't use a variable there.

Then why did the OP say "Can't use a \x variable" instead of "can't use a variable"?

If I say "The Western sky is orange", doesn't that tell you something about the Eastern sky? At the very least, I'm leaving the possibility of the Eastern sky being a different colour. In fact, it's quite likely it's either a different colour or I don't know it's colour.

capture buffers (which I guess means $1 instead of \1?)

I mean "what is captured". Technically, they exist as a reference to the string being matched, a start position and an end position (or something similar).

$1 and \1 are both windows into them, and so are @-, @+, %-,%+ and $^N.

since their values don't change during the regex match

They're not used at all during regex matching. There isn't even a regex opcode to refer to them. The only way they can be accessed is via \1 (etc) and via Perl code blocks ((?{ }) and (??{ }). Neither of those can be used in a quantifier.

And if they don't change — if you can't even give them a value — how can you consider them variables?

In reply to Re^7: Regex fun by ikegami
in thread Regex fun by Hena

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others taking refuge in the Monastery: (2)
    As of 2021-05-08 02:18 GMT
    Find Nodes?
      Voting Booth?
      Perl 7 will be out ...

      Results (95 votes). Check out past polls.