Hmmm...I get "NOT MATCHED!", but no error message. But there are other inconsistencies.
Putting several into a single script:
#!/usr/bin/perl
use strict;
use warnings;
our $quotes = '"' . ('\"' x 10000000) . '"';
print "Length of string is ", length($quotes), "\n";
our @qr;
push @qr, qr/^ " (?: [^"\\]++ | \\. )*+ " /x ;
push @qr, qr/^ " (?: [^"\\]++ | (?: \\. )++ )*+ " /x ;
push @qr, qr/^ " (?: [^"\\]+ | (?: \\. )+ )*+ " /x ;
for my $i (0..$#qr) {
print "$i) $qr[$i] ==> ";
print "NOT " unless $quotes =~ $qr[$i];
print "MATCHED!\n";
}
__END__
Length of string is 20000002
Complex regular subexpression recursion limit (32766) exceeded at ./pm
+1200316.pl line 16.
0) (?^x:^ " (?: [^"\\]++ | \\. )*+ " ) ==> NOT MATCHED!
1) (?^x:^ " (?: [^"\\]++ | (?: \\. )++ )*+ " ) ==> MATCHED!
2) (?^x:^ " (?: [^"\\]+ | (?: \\. )+ )*+ " ) ==> MATCHED!
perl -v
This is perl 5, version 22, subversion 1 (v5.22.1) built for x86_64-li
+nux-gnu-thread-multi
(with 58 registered patches, see perl -V for more detail)
Copyright 1987-2015, Larry Wall
-QM
--
Quantum Mechanics: The dreams stuff is made of
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|