> Just to make sure I understand the question, you're looking for a regex that does the equivalent of the following regex,

Yes, even without testing this looks right, your embedded Perl excludes all former characters in a character class.*

> Personally, I don't find this particular (??{ }) construct too terrible...

It's a theoretical question, I wouldn't use a regex anyway. It's about exploring the limits.

> but without (?{ }) or (??{ })? (Anything else that's not allowed?) 

Basically yes.

The less cheating the better, ie a portable solution would be perfect. (Bigly doubt)

Using implementation details or experimental features less so. (Sad )

> Update: A bit of research on variable-width lookbehind:

Regarding the older discussions:

I don't see how \K could be applied here, the perldocs are IMHO wrong to claim it was generally allowing variable length look behinds.

IMHO does \K only apply for s/// .

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

*) that's the approach I would try to implement with recursive patterns


In reply to Re^2: Regex: matching character which happens exactly once by LanX
in thread Regex: matching character which happens exactly once by LanX

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.