Note that there are some explanatory texts on larger screens.

plurals
  1. POperlre length limit
    text
    copied!<p>From <a href="http://perldoc.perl.org/perlre.html"><code>man perlre</code></a>:</p> <blockquote> <p>The "*" quantifier is equivalent to "{0,}", the "+" quantifier to "{1,}", and the "?" quantifier to "{0,1}". n and m are limited to integral values less than a preset limit defined when perl is built. This is usually 32766 on the most common platforms. The actual limit can be seen in the error message generated by code such as this:</p> <pre><code> $_ **= $_ , / {$_} / for 2 .. 42; </code></pre> </blockquote> <p>Ay that's ugly - Isn't there some constant I can get instead?</p> <p>Edit: As daxim pointed out (and <a href="http://perldoc.perl.org/perlretut.html">perlretut</a> hints towards) it might be that 32767 is a magical hardcoded number. A little <a href="http://perl5.git.perl.org/perl.git/blob?f=t/re/pat.t#l305">searching</a> in the Perl code goes a long way, but I'm not sure how to get to the next step and actually find out where the default reg_infty or REG_INFTY is actually set:</p> <pre><code>~/dev/perl-5.12.2 $ grep -ri 'reg_infty.*=' * regexec.c: if (max != REG_INFTY &amp;&amp; ST.count == max) t/re/pat.t: $::reg_infty = $Config {reg_infty} // 32767; t/re/pat.t: $::reg_infty_m = $::reg_infty - 1; t/re/pat.t: $::reg_infty_p = $::reg_infty + 1; t/re/pat.t: $::reg_infty_m = $::reg_infty_m; # Surpress warning. </code></pre> <p>Edit 2: DVK is of course right: It's <code>define</code>d at compile time, and can probably be overridden only with <code>REG_INFTY</code>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload