| 158 |
|
|
| 159 |
if (length > md->end_subject - eptr) return FALSE; |
if (length > md->end_subject - eptr) return FALSE; |
| 160 |
|
|
| 161 |
/* Separate the caselesss case for speed */ |
/* Separate the caseless case for speed. In UTF-8 mode we can only do this |
| 162 |
|
properly if Unicode properties are supported. Otherwise, we can check only |
| 163 |
|
ASCII characters. */ |
| 164 |
|
|
| 165 |
if ((ims & PCRE_CASELESS) != 0) |
if ((ims & PCRE_CASELESS) != 0) |
| 166 |
{ |
{ |
| 167 |
|
#ifdef SUPPORT_UTF8 |
| 168 |
|
#ifdef SUPPORT_UCP |
| 169 |
|
if (md->utf8) |
| 170 |
|
{ |
| 171 |
|
USPTR endptr = eptr + length; |
| 172 |
|
while (eptr < endptr) |
| 173 |
|
{ |
| 174 |
|
int c, d; |
| 175 |
|
GETCHARINC(c, eptr); |
| 176 |
|
GETCHARINC(d, p); |
| 177 |
|
if (c != d && c != UCD_OTHERCASE(d)) return FALSE; |
| 178 |
|
} |
| 179 |
|
} |
| 180 |
|
else |
| 181 |
|
#endif |
| 182 |
|
#endif |
| 183 |
|
|
| 184 |
|
/* The same code works when not in UTF-8 mode and in UTF-8 mode when there |
| 185 |
|
is no UCP support. */ |
| 186 |
|
|
| 187 |
while (length-- > 0) |
while (length-- > 0) |
| 188 |
if (md->lcc[*p++] != md->lcc[*eptr++]) return FALSE; |
{ if (md->lcc[*p++] != md->lcc[*eptr++]) return FALSE; } |
| 189 |
} |
} |
| 190 |
|
|
| 191 |
|
/* In the caseful case, we can just compare the bytes, whether or not we |
| 192 |
|
are in UTF-8 mode. */ |
| 193 |
|
|
| 194 |
else |
else |
| 195 |
{ while (length-- > 0) if (*p++ != *eptr++) return FALSE; } |
{ while (length-- > 0) if (*p++ != *eptr++) return FALSE; } |
| 196 |
|
|
| 1456 |
|
|
| 1457 |
case OP_ANY: |
case OP_ANY: |
| 1458 |
if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH); |
if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH); |
| 1459 |
/* Fall through */ |
/* Fall through */ |
| 1460 |
|
|
| 1461 |
case OP_ALLANY: |
case OP_ALLANY: |
| 1462 |
if (eptr++ >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr++ >= md->end_subject) RRETURN(MATCH_NOMATCH); |
| 1463 |
if (utf8) while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; |
if (utf8) while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; |
| 1679 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
| 1680 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 1681 |
{ |
{ |
| 1682 |
int chartype, script; |
const ucd_record * prop = GET_UCD(c); |
|
int category = _pcre_ucp_findprop(c, &chartype, &script); |
|
| 1683 |
|
|
| 1684 |
switch(ecode[1]) |
switch(ecode[1]) |
| 1685 |
{ |
{ |
| 1688 |
break; |
break; |
| 1689 |
|
|
| 1690 |
case PT_LAMP: |
case PT_LAMP: |
| 1691 |
if ((chartype == ucp_Lu || |
if ((prop->chartype == ucp_Lu || |
| 1692 |
chartype == ucp_Ll || |
prop->chartype == ucp_Ll || |
| 1693 |
chartype == ucp_Lt) == (op == OP_NOTPROP)) |
prop->chartype == ucp_Lt) == (op == OP_NOTPROP)) |
| 1694 |
RRETURN(MATCH_NOMATCH); |
RRETURN(MATCH_NOMATCH); |
| 1695 |
break; |
break; |
| 1696 |
|
|
| 1697 |
case PT_GC: |
case PT_GC: |
| 1698 |
if ((ecode[2] != category) == (op == OP_PROP)) |
if ((ecode[2] != _pcre_ucp_gentype[prop->chartype]) == (op == OP_PROP)) |
| 1699 |
RRETURN(MATCH_NOMATCH); |
RRETURN(MATCH_NOMATCH); |
| 1700 |
break; |
break; |
| 1701 |
|
|
| 1702 |
case PT_PC: |
case PT_PC: |
| 1703 |
if ((ecode[2] != chartype) == (op == OP_PROP)) |
if ((ecode[2] != prop->chartype) == (op == OP_PROP)) |
| 1704 |
RRETURN(MATCH_NOMATCH); |
RRETURN(MATCH_NOMATCH); |
| 1705 |
break; |
break; |
| 1706 |
|
|
| 1707 |
case PT_SC: |
case PT_SC: |
| 1708 |
if ((ecode[2] != script) == (op == OP_PROP)) |
if ((ecode[2] != prop->script) == (op == OP_PROP)) |
| 1709 |
RRETURN(MATCH_NOMATCH); |
RRETURN(MATCH_NOMATCH); |
| 1710 |
break; |
break; |
| 1711 |
|
|
| 1724 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
| 1725 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 1726 |
{ |
{ |
| 1727 |
int chartype, script; |
int category = UCD_CATEGORY(c); |
|
int category = _pcre_ucp_findprop(c, &chartype, &script); |
|
| 1728 |
if (category == ucp_M) RRETURN(MATCH_NOMATCH); |
if (category == ucp_M) RRETURN(MATCH_NOMATCH); |
| 1729 |
while (eptr < md->end_subject) |
while (eptr < md->end_subject) |
| 1730 |
{ |
{ |
| 1733 |
{ |
{ |
| 1734 |
GETCHARLEN(c, eptr, len); |
GETCHARLEN(c, eptr, len); |
| 1735 |
} |
} |
| 1736 |
category = _pcre_ucp_findprop(c, &chartype, &script); |
category = UCD_CATEGORY(c); |
| 1737 |
if (category != ucp_M) break; |
if (category != ucp_M) break; |
| 1738 |
eptr += len; |
eptr += len; |
| 1739 |
} |
} |
| 1754 |
case OP_REF: |
case OP_REF: |
| 1755 |
{ |
{ |
| 1756 |
offset = GET2(ecode, 1) << 1; /* Doubled ref number */ |
offset = GET2(ecode, 1) << 1; /* Doubled ref number */ |
| 1757 |
ecode += 3; |
ecode += 3; |
| 1758 |
|
|
| 1759 |
/* If the reference is unset, there are two possibilities: |
/* If the reference is unset, there are two possibilities: |
| 1760 |
|
|
| 1761 |
(a) In the default, Perl-compatible state, set the length to be longer |
(a) In the default, Perl-compatible state, set the length to be longer |
| 1762 |
than the amount of subject left; this ensures that every attempt at a |
than the amount of subject left; this ensures that every attempt at a |
| 1763 |
match fails. We can't just fail here, because of the possibility of |
match fails. We can't just fail here, because of the possibility of |
| 1764 |
quantifiers with zero minima. |
quantifiers with zero minima. |
| 1765 |
|
|
| 1766 |
(b) If the JavaScript compatibility flag is set, set the length to zero |
(b) If the JavaScript compatibility flag is set, set the length to zero |
| 1767 |
so that the back reference matches an empty string. |
so that the back reference matches an empty string. |
| 1768 |
|
|
| 1769 |
Otherwise, set the length to the length of what was matched by the |
Otherwise, set the length to the length of what was matched by the |
| 1770 |
referenced subpattern. */ |
referenced subpattern. */ |
| 1771 |
|
|
| 1772 |
if (offset >= offset_top || md->offset_vector[offset] < 0) |
if (offset >= offset_top || md->offset_vector[offset] < 0) |
| 1773 |
length = (md->jscript_compat)? 0 : md->end_subject - eptr + 1; |
length = (md->jscript_compat)? 0 : md->end_subject - eptr + 1; |
| 1774 |
else |
else |
| 1775 |
length = md->offset_vector[offset+1] - md->offset_vector[offset]; |
length = md->offset_vector[offset+1] - md->offset_vector[offset]; |
| 1776 |
|
|
| 2198 |
if (fc != dc) |
if (fc != dc) |
| 2199 |
{ |
{ |
| 2200 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
| 2201 |
if (dc != _pcre_ucp_othercase(fc)) |
if (dc != UCD_OTHERCASE(fc)) |
| 2202 |
#endif |
#endif |
| 2203 |
RRETURN(MATCH_NOMATCH); |
RRETURN(MATCH_NOMATCH); |
| 2204 |
} |
} |
| 2289 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
| 2290 |
unsigned int othercase; |
unsigned int othercase; |
| 2291 |
if ((ims & PCRE_CASELESS) != 0 && |
if ((ims & PCRE_CASELESS) != 0 && |
| 2292 |
(othercase = _pcre_ucp_othercase(fc)) != NOTACHAR) |
(othercase = UCD_OTHERCASE(fc)) != fc) |
| 2293 |
oclength = _pcre_ord2utf8(othercase, occhars); |
oclength = _pcre_ord2utf8(othercase, occhars); |
| 2294 |
else oclength = 0; |
else oclength = 0; |
| 2295 |
#endif /* SUPPORT_UCP */ |
#endif /* SUPPORT_UCP */ |
| 2609 |
{ |
{ |
| 2610 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM28); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM28); |
| 2611 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2612 |
|
if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
| 2613 |
GETCHARINC(d, eptr); |
GETCHARINC(d, eptr); |
| 2614 |
if (d < 256) d = md->lcc[d]; |
if (d < 256) d = md->lcc[d]; |
| 2615 |
if (fi >= max || eptr >= md->end_subject || fc == d) |
if (fc == d) RRETURN(MATCH_NOMATCH); |
| 2616 |
RRETURN(MATCH_NOMATCH); |
|
| 2617 |
} |
} |
| 2618 |
} |
} |
| 2619 |
else |
else |
| 2719 |
{ |
{ |
| 2720 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM32); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM32); |
| 2721 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2722 |
|
if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
| 2723 |
GETCHARINC(d, eptr); |
GETCHARINC(d, eptr); |
| 2724 |
if (fi >= max || eptr >= md->end_subject || fc == d) |
if (fc == d) RRETURN(MATCH_NOMATCH); |
|
RRETURN(MATCH_NOMATCH); |
|
| 2725 |
} |
} |
| 2726 |
} |
} |
| 2727 |
else |
else |
| 2895 |
{ |
{ |
| 2896 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
| 2897 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 2898 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_chartype = UCD_CHARTYPE(c); |
| 2899 |
if ((prop_chartype == ucp_Lu || |
if ((prop_chartype == ucp_Lu || |
| 2900 |
prop_chartype == ucp_Ll || |
prop_chartype == ucp_Ll || |
| 2901 |
prop_chartype == ucp_Lt) == prop_fail_result) |
prop_chartype == ucp_Lt) == prop_fail_result) |
| 2908 |
{ |
{ |
| 2909 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
| 2910 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 2911 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_category = UCD_CATEGORY(c); |
| 2912 |
if ((prop_category == prop_value) == prop_fail_result) |
if ((prop_category == prop_value) == prop_fail_result) |
| 2913 |
RRETURN(MATCH_NOMATCH); |
RRETURN(MATCH_NOMATCH); |
| 2914 |
} |
} |
| 2919 |
{ |
{ |
| 2920 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
| 2921 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 2922 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_chartype = UCD_CHARTYPE(c); |
| 2923 |
if ((prop_chartype == prop_value) == prop_fail_result) |
if ((prop_chartype == prop_value) == prop_fail_result) |
| 2924 |
RRETURN(MATCH_NOMATCH); |
RRETURN(MATCH_NOMATCH); |
| 2925 |
} |
} |
| 2930 |
{ |
{ |
| 2931 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
| 2932 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 2933 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_script = UCD_SCRIPT(c); |
| 2934 |
if ((prop_script == prop_value) == prop_fail_result) |
if ((prop_script == prop_value) == prop_fail_result) |
| 2935 |
RRETURN(MATCH_NOMATCH); |
RRETURN(MATCH_NOMATCH); |
| 2936 |
} |
} |
| 2949 |
for (i = 1; i <= min; i++) |
for (i = 1; i <= min; i++) |
| 2950 |
{ |
{ |
| 2951 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 2952 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_category = UCD_CATEGORY(c); |
| 2953 |
if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); |
if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); |
| 2954 |
while (eptr < md->end_subject) |
while (eptr < md->end_subject) |
| 2955 |
{ |
{ |
| 2958 |
{ |
{ |
| 2959 |
GETCHARLEN(c, eptr, len); |
GETCHARLEN(c, eptr, len); |
| 2960 |
} |
} |
| 2961 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_category = UCD_CATEGORY(c); |
| 2962 |
if (prop_category != ucp_M) break; |
if (prop_category != ucp_M) break; |
| 2963 |
eptr += len; |
eptr += len; |
| 2964 |
} |
} |
| 3374 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3375 |
if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
| 3376 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
| 3377 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_chartype = UCD_CHARTYPE(c); |
| 3378 |
if ((prop_chartype == ucp_Lu || |
if ((prop_chartype == ucp_Lu || |
| 3379 |
prop_chartype == ucp_Ll || |
prop_chartype == ucp_Ll || |
| 3380 |
prop_chartype == ucp_Lt) == prop_fail_result) |
prop_chartype == ucp_Lt) == prop_fail_result) |
| 3389 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3390 |
if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
| 3391 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
| 3392 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_category = UCD_CATEGORY(c); |
| 3393 |
if ((prop_category == prop_value) == prop_fail_result) |
if ((prop_category == prop_value) == prop_fail_result) |
| 3394 |
RRETURN(MATCH_NOMATCH); |
RRETURN(MATCH_NOMATCH); |
| 3395 |
} |
} |
| 3402 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3403 |
if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
| 3404 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
| 3405 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_chartype = UCD_CHARTYPE(c); |
| 3406 |
if ((prop_chartype == prop_value) == prop_fail_result) |
if ((prop_chartype == prop_value) == prop_fail_result) |
| 3407 |
RRETURN(MATCH_NOMATCH); |
RRETURN(MATCH_NOMATCH); |
| 3408 |
} |
} |
| 3415 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3416 |
if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
| 3417 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
| 3418 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_script = UCD_SCRIPT(c); |
| 3419 |
if ((prop_script == prop_value) == prop_fail_result) |
if ((prop_script == prop_value) == prop_fail_result) |
| 3420 |
RRETURN(MATCH_NOMATCH); |
RRETURN(MATCH_NOMATCH); |
| 3421 |
} |
} |
| 3437 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3438 |
if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
| 3439 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 3440 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_category = UCD_CATEGORY(c); |
| 3441 |
if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); |
if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); |
| 3442 |
while (eptr < md->end_subject) |
while (eptr < md->end_subject) |
| 3443 |
{ |
{ |
| 3446 |
{ |
{ |
| 3447 |
GETCHARLEN(c, eptr, len); |
GETCHARLEN(c, eptr, len); |
| 3448 |
} |
} |
| 3449 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_category = UCD_CATEGORY(c); |
| 3450 |
if (prop_category != ucp_M) break; |
if (prop_category != ucp_M) break; |
| 3451 |
eptr += len; |
eptr += len; |
| 3452 |
} |
} |
| 3472 |
switch(ctype) |
switch(ctype) |
| 3473 |
{ |
{ |
| 3474 |
case OP_ANY: /* This is the non-NL case */ |
case OP_ANY: /* This is the non-NL case */ |
| 3475 |
case OP_ALLANY: |
case OP_ALLANY: |
| 3476 |
case OP_ANYBYTE: |
case OP_ANYBYTE: |
| 3477 |
break; |
break; |
| 3478 |
|
|
| 3631 |
switch(ctype) |
switch(ctype) |
| 3632 |
{ |
{ |
| 3633 |
case OP_ANY: /* This is the non-NL case */ |
case OP_ANY: /* This is the non-NL case */ |
| 3634 |
case OP_ALLANY: |
case OP_ALLANY: |
| 3635 |
case OP_ANYBYTE: |
case OP_ANYBYTE: |
| 3636 |
break; |
break; |
| 3637 |
|
|
| 3764 |
int len = 1; |
int len = 1; |
| 3765 |
if (eptr >= md->end_subject) break; |
if (eptr >= md->end_subject) break; |
| 3766 |
GETCHARLEN(c, eptr, len); |
GETCHARLEN(c, eptr, len); |
| 3767 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_chartype = UCD_CHARTYPE(c); |
| 3768 |
if ((prop_chartype == ucp_Lu || |
if ((prop_chartype == ucp_Lu || |
| 3769 |
prop_chartype == ucp_Ll || |
prop_chartype == ucp_Ll || |
| 3770 |
prop_chartype == ucp_Lt) == prop_fail_result) |
prop_chartype == ucp_Lt) == prop_fail_result) |
| 3779 |
int len = 1; |
int len = 1; |
| 3780 |
if (eptr >= md->end_subject) break; |
if (eptr >= md->end_subject) break; |
| 3781 |
GETCHARLEN(c, eptr, len); |
GETCHARLEN(c, eptr, len); |
| 3782 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_category = UCD_CATEGORY(c); |
| 3783 |
if ((prop_category == prop_value) == prop_fail_result) |
if ((prop_category == prop_value) == prop_fail_result) |
| 3784 |
break; |
break; |
| 3785 |
eptr+= len; |
eptr+= len; |
| 3792 |
int len = 1; |
int len = 1; |
| 3793 |
if (eptr >= md->end_subject) break; |
if (eptr >= md->end_subject) break; |
| 3794 |
GETCHARLEN(c, eptr, len); |
GETCHARLEN(c, eptr, len); |
| 3795 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_chartype = UCD_CHARTYPE(c); |
| 3796 |
if ((prop_chartype == prop_value) == prop_fail_result) |
if ((prop_chartype == prop_value) == prop_fail_result) |
| 3797 |
break; |
break; |
| 3798 |
eptr+= len; |
eptr+= len; |
| 3805 |
int len = 1; |
int len = 1; |
| 3806 |
if (eptr >= md->end_subject) break; |
if (eptr >= md->end_subject) break; |
| 3807 |
GETCHARLEN(c, eptr, len); |
GETCHARLEN(c, eptr, len); |
| 3808 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_script = UCD_SCRIPT(c); |
| 3809 |
if ((prop_script == prop_value) == prop_fail_result) |
if ((prop_script == prop_value) == prop_fail_result) |
| 3810 |
break; |
break; |
| 3811 |
eptr+= len; |
eptr+= len; |
| 3834 |
{ |
{ |
| 3835 |
if (eptr >= md->end_subject) break; |
if (eptr >= md->end_subject) break; |
| 3836 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 3837 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_category = UCD_CATEGORY(c); |
| 3838 |
if (prop_category == ucp_M) break; |
if (prop_category == ucp_M) break; |
| 3839 |
while (eptr < md->end_subject) |
while (eptr < md->end_subject) |
| 3840 |
{ |
{ |
| 3843 |
{ |
{ |
| 3844 |
GETCHARLEN(c, eptr, len); |
GETCHARLEN(c, eptr, len); |
| 3845 |
} |
} |
| 3846 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_category = UCD_CATEGORY(c); |
| 3847 |
if (prop_category != ucp_M) break; |
if (prop_category != ucp_M) break; |
| 3848 |
eptr += len; |
eptr += len; |
| 3849 |
} |
} |
| 3865 |
BACKCHAR(eptr); |
BACKCHAR(eptr); |
| 3866 |
GETCHARLEN(c, eptr, len); |
GETCHARLEN(c, eptr, len); |
| 3867 |
} |
} |
| 3868 |
prop_category = _pcre_ucp_findprop(c, &prop_chartype, &prop_script); |
prop_category = UCD_CATEGORY(c); |
| 3869 |
if (prop_category != ucp_M) break; |
if (prop_category != ucp_M) break; |
| 3870 |
eptr--; |
eptr--; |
| 3871 |
} |
} |
| 4385 |
< -1 => some kind of unexpected problem |
< -1 => some kind of unexpected problem |
| 4386 |
*/ |
*/ |
| 4387 |
|
|
| 4388 |
PCRE_EXP_DEFN int |
PCRE_EXP_DEFN int PCRE_CALL_CONVENTION |
| 4389 |
pcre_exec(const pcre *argument_re, const pcre_extra *extra_data, |
pcre_exec(const pcre *argument_re, const pcre_extra *extra_data, |
| 4390 |
PCRE_SPTR subject, int length, int start_offset, int options, int *offsets, |
PCRE_SPTR subject, int length, int start_offset, int options, int *offsets, |
| 4391 |
int offsetcount) |
int offsetcount) |
| 4697 |
if (firstline) |
if (firstline) |
| 4698 |
{ |
{ |
| 4699 |
USPTR t = start_match; |
USPTR t = start_match; |
| 4700 |
|
#ifdef SUPPORT_UTF8 |
| 4701 |
|
if (utf8) |
| 4702 |
|
{ |
| 4703 |
|
while (t < md->end_subject && !IS_NEWLINE(t)) |
| 4704 |
|
{ |
| 4705 |
|
t++; |
| 4706 |
|
while (t < end_subject && (*t & 0xc0) == 0x80) t++; |
| 4707 |
|
} |
| 4708 |
|
} |
| 4709 |
|
else |
| 4710 |
|
#endif |
| 4711 |
while (t < md->end_subject && !IS_NEWLINE(t)) t++; |
while (t < md->end_subject && !IS_NEWLINE(t)) t++; |
| 4712 |
end_subject = t; |
end_subject = t; |
| 4713 |
} |
} |
| 4714 |
|
|
| 4715 |
/* Now test for a unique first byte */ |
/* Now advance to a unique first byte if there is one. */ |
| 4716 |
|
|
| 4717 |
if (first_byte >= 0) |
if (first_byte >= 0) |
| 4718 |
{ |
{ |
| 4719 |
if (first_byte_caseless) |
if (first_byte_caseless) |
| 4720 |
while (start_match < end_subject && |
while (start_match < end_subject && md->lcc[*start_match] != first_byte) |
| 4721 |
md->lcc[*start_match] != first_byte) |
start_match++; |
|
{ NEXTCHAR(start_match); } |
|
| 4722 |
else |
else |
| 4723 |
while (start_match < end_subject && *start_match != first_byte) |
while (start_match < end_subject && *start_match != first_byte) |
| 4724 |
{ NEXTCHAR(start_match); } |
start_match++; |
| 4725 |
} |
} |
| 4726 |
|
|
| 4727 |
/* Or to just after a linebreak for a multiline match if possible */ |
/* Or to just after a linebreak for a multiline match */ |
| 4728 |
|
|
| 4729 |
else if (startline) |
else if (startline) |
| 4730 |
{ |
{ |
| 4731 |
if (start_match > md->start_subject + start_offset) |
if (start_match > md->start_subject + start_offset) |
| 4732 |
{ |
{ |
| 4733 |
while (start_match <= end_subject && !WAS_NEWLINE(start_match)) |
#ifdef SUPPORT_UTF8 |
| 4734 |
{ NEXTCHAR(start_match); } |
if (utf8) |
| 4735 |
|
{ |
| 4736 |
|
while (start_match < end_subject && !WAS_NEWLINE(start_match)) |
| 4737 |
|
{ |
| 4738 |
|
start_match++; |
| 4739 |
|
while(start_match < end_subject && (*start_match & 0xc0) == 0x80) |
| 4740 |
|
start_match++; |
| 4741 |
|
} |
| 4742 |
|
} |
| 4743 |
|
else |
| 4744 |
|
#endif |
| 4745 |
|
while (start_match < end_subject && !WAS_NEWLINE(start_match)) |
| 4746 |
|
start_match++; |
| 4747 |
|
|
| 4748 |
/* If we have just passed a CR and the newline option is ANY or ANYCRLF, |
/* If we have just passed a CR and the newline option is ANY or ANYCRLF, |
| 4749 |
and we are now at a LF, advance the match position by one more character. |
and we are now at a LF, advance the match position by one more character. |
| 4757 |
} |
} |
| 4758 |
} |
} |
| 4759 |
|
|
| 4760 |
/* Or to a non-unique first char after study */ |
/* Or to a non-unique first byte after study */ |
| 4761 |
|
|
| 4762 |
else if (start_bits != NULL) |
else if (start_bits != NULL) |
| 4763 |
{ |
{ |
| 4764 |
while (start_match < end_subject) |
while (start_match < end_subject) |
| 4765 |
{ |
{ |
| 4766 |
register unsigned int c = *start_match; |
register unsigned int c = *start_match; |
| 4767 |
if ((start_bits[c/8] & (1 << (c&7))) == 0) |
if ((start_bits[c/8] & (1 << (c&7))) == 0) start_match++; |
| 4768 |
{ NEXTCHAR(start_match); } |
else break; |
|
else break; |
|
| 4769 |
} |
} |
| 4770 |
} |
} |
| 4771 |
|
|