From: Hugo van der Sanden Date: Wed, 27 Mar 2002 12:39:57 +0000 (+0000) Subject: Re: Regex-Unicode bugs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=af6f566ede304ed0d544d51e1e8e01bc3184a3f4;p=p5sagit%2Fp5-mst-13.2.git Re: Regex-Unicode bugs Message-Id: <200203271239.g2RCdvL31355@crypt.compulink.co.uk> p4raw-id: //depot/perl@15573 --- diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 7808f88..d140b0a 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1328,7 +1328,9 @@ unlikely to be what you want. =item Empty %s -(F) Empty C<\p{}> or C<\P{}>. +(F) C<\p> and C<\P> are used to introduce a named Unicode property, as +described in L and L. You used C<\p> or C<\P> in +a regular expression without specifying the property name. =item entering effective %s failed diff --git a/regcomp.c b/regcomp.c index 12f9016..c124d48 100644 --- a/regcomp.c +++ b/regcomp.c @@ -2970,8 +2970,11 @@ tryagain: } RExC_end++; } - else + else { RExC_end = RExC_parse + 2; + if (RExC_end > oldregxend) + RExC_end = oldregxend; + } RExC_parse--; ret = regclass(pRExC_state); @@ -3593,6 +3596,8 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state) case 'D': namedclass = ANYOF_NDIGIT; break; case 'p': case 'P': + if (RExC_parse >= RExC_end) + vFAIL("Empty \\p{}"); if (*RExC_parse == '{') { U8 c = (U8)value; e = strchr(RExC_parse++, '}');