(W regexp) Minima should be less than or equal to maxima. If you really
want your regexp to match something 0 times, just put {0}.
-=item Quantifier unexpected on zero-length expression in regex; marked by <--
-HERE in m/%s/
+=item Quantifier unexpected on zero-length expression in regex m/%s/
(W regexp) You applied a regular expression quantifier in a place where
it makes no sense, such as on a zero-width assertion. Try putting the
"abc" provided that it is followed by three repetitions of "xyz" is
C</abc(?=(?:xyz){3})/>, not C</abc(?=xyz){3}/>.
-The <-- HERE shows whereabouts in the regular expression the problem was
-discovered.
-
=item Range iterator outside integer range
(F) One (or both) of the numeric arguments to the range operator ".."
{
/* Fatal warnings may leak the regexp without this: */
SAVEFREESV(RExC_rx_sv);
- ckWARNreg(RExC_parse,
- "Quantifier unexpected on zero-length expression");
+ Perl_ck_warner(aTHX_ packWARN(WARN_REGEXP),
+ "Quantifier unexpected on zero-length expression "
+ "in regex m/%"UTF8f"/",
+ UTF8fARG(UTF, RExC_end - RExC_precomp,
+ RExC_precomp));
(void)ReREFCNT_inc(RExC_rx_sv);
}
'my $x = \'\m\'; qr/a$x/' => 'Unrecognized escape \m passed through {#} m/a\m{#}/',
'/\q/' => 'Unrecognized escape \q passed through {#} m/\q{#}/',
- # Feel free to modify these 2 tests, should they start failing because the
- # marker of where the problem is becomes wrong. The current behavior is
- # bad, always marking at the very end of the regex instead of where the
- # problem is. See [perl #122680] regcomp warning gives wrong position of
+ # These two tests do not include the marker, because regcomp.c no
+ # longer knows where it goes by the time this warning is emitted.
+ # See [perl #122680] regcomp warning gives wrong position of
# problem.
- '/(?=a){1,3}\x{100}/' => 'Quantifier unexpected on zero-length expression {#} m/(?=a){1,3}\x{100}{#}/',
- '/(a|b)(?=a){3}\x{100}/' => 'Quantifier unexpected on zero-length expression {#} m/(a|b)(?=a){3}\x{100}{#}/',
+ '/(?=a){1,3}\x{100}/' => 'Quantifier unexpected on zero-length expression in regex m/(?=a){1,3}\x{100}/',
+ '/(a|b)(?=a){3}\x{100}/' => 'Quantifier unexpected on zero-length expression in regex m/(a|b)(?=a){3}\x{100}/',
'/\_/' => "",
'/[\_\0]/' => "",