OK, here's what perlre(1) says about (??{}):
       ""(??{ code })""
                 WARNING: This extended regular expression fea-
                 ture is considered highly experimental, and may
                 be changed or deleted without notice.  A simpli-
                 fied version of the syntax may be introduced for
                 commonly used idioms.

                 This is a "postponed" regular subexpression.
                 The "code" is evaluated at run time, at the
                 moment this subexpression may match.  The result
                 of evaluation is considered as a regular expres-
                 sion and matched as if it were inserted instead
                 of this construct.

So the RE first matches any character $1, followed by zero or more of any character. Then it evaluates the code in the (??{}). This code evaluates to a character class for a character outside of the range [$1-z]---a character earlier in the alphabet.

If you change the code to print what it's trying, it's clearer what's going on:

if ($ARGV[0] !~ /(.).*(??{print "Searching for [^$1-z] starting at ",p +os($ARGV[0]),"\n"; "[^$1-z]"})/ix)
produces
[sgifford@sglaptop sgifford]$ perl /tmp/t4 abcd Searching for [^a-z] starting at 4 Searching for [^a-z] starting at 3 Searching for [^a-z] starting at 2 Searching for [^a-z] starting at 1 Searching for [^b-z] starting at 4 Searching for [^b-z] starting at 3 Searching for [^b-z] starting at 2 Searching for [^c-z] starting at 4 Searching for [^c-z] starting at 3 Searching for [^d-z] starting at 4 alpha

Other solutions are more efficient, but the OP asked for an RE. :-)


In reply to Re: Re: Re: Regexp for alphabetical order match within the string by sgifford
in thread Regexp for alphabetical order match within the string by prostoalex

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.