Thank you! That was deeply instructive -- where I work I code primarily in a vacuum (well, there is one other Perl user, but he's just now learning), so it's nice to see the thought process of a more experienced Monk.

Just out of curiosity, I note that you used the Perl-only capability of executing Perl code inside a conditional. Despite being *way* off topic, I am interested to know if that's really the only sensible way to do this (that is, accomplish my goal using a conditional rather than an alternation). For example, if I were to use Jakarta-ORO (Perl-style regex engine for Java), I suspect I wouldn't have that facility.

Feel free to /msg me if you don't want to carry this OT discussion in-thread, we could pick it up in e-mail. Or, if you prefer, could you recommend a chapter of Mastering Regular Expressions that covers the topic well? I've bought the book, but haven't yet had the time to read it start-to-finish.

<radiant.matrix>
Ramblings and references
The Code that can be seen is not the true Code
I haven't found a problem yet that can't be solved by a well-placed trebuchet

In reply to Re^4: Regex conditional match if previous match in same expression is true? by radiantmatrix
in thread Regex conditional match if previous match in same expression is true? by radiantmatrix

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.