1354 |
{ |
{ |
1355 |
int chartype, rqdtype; |
int chartype, rqdtype; |
1356 |
int othercase; |
int othercase; |
1357 |
int category = ucp_findchar(c, &chartype, &othercase); |
int category = _pcre_ucp_findchar(c, &chartype, &othercase); |
1358 |
|
|
1359 |
rqdtype = *(++ecode); |
rqdtype = *(++ecode); |
1360 |
ecode++; |
ecode++; |
1381 |
{ |
{ |
1382 |
int chartype; |
int chartype; |
1383 |
int othercase; |
int othercase; |
1384 |
int category = ucp_findchar(c, &chartype, &othercase); |
int category = _pcre_ucp_findchar(c, &chartype, &othercase); |
1385 |
if (category == ucp_M) RRETURN(MATCH_NOMATCH); |
if (category == ucp_M) RRETURN(MATCH_NOMATCH); |
1386 |
while (eptr < md->end_subject) |
while (eptr < md->end_subject) |
1387 |
{ |
{ |
1390 |
{ |
{ |
1391 |
GETCHARLEN(c, eptr, len); |
GETCHARLEN(c, eptr, len); |
1392 |
} |
} |
1393 |
category = ucp_findchar(c, &chartype, &othercase); |
category = _pcre_ucp_findchar(c, &chartype, &othercase); |
1394 |
if (category != ucp_M) break; |
if (category != ucp_M) break; |
1395 |
eptr += len; |
eptr += len; |
1396 |
} |
} |
1841 |
ecode += length; |
ecode += length; |
1842 |
|
|
1843 |
/* If we have Unicode property support, we can use it to test the other |
/* If we have Unicode property support, we can use it to test the other |
1844 |
case of the character, if there is one. The result of ucp_findchar() is |
case of the character, if there is one. The result of _pcre_ucp_findchar() is |
1845 |
< 0 if the char isn't found, and othercase is returned as zero if there |
< 0 if the char isn't found, and othercase is returned as zero if there |
1846 |
isn't one. */ |
isn't one. */ |
1847 |
|
|
1850 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
1851 |
int chartype; |
int chartype; |
1852 |
int othercase; |
int othercase; |
1853 |
if (ucp_findchar(fc, &chartype, &othercase) < 0 || dc != othercase) |
if (_pcre_ucp_findchar(fc, &chartype, &othercase) < 0 || dc != othercase) |
1854 |
#endif |
#endif |
1855 |
RRETURN(MATCH_NOMATCH); |
RRETURN(MATCH_NOMATCH); |
1856 |
} |
} |
1920 |
int othercase; |
int othercase; |
1921 |
int chartype; |
int chartype; |
1922 |
if ((ims & PCRE_CASELESS) != 0 && |
if ((ims & PCRE_CASELESS) != 0 && |
1923 |
ucp_findchar(fc, &chartype, &othercase) >= 0 && |
_pcre_ucp_findchar(fc, &chartype, &othercase) >= 0 && |
1924 |
othercase > 0) |
othercase > 0) |
1925 |
oclength = _pcre_ord2utf8(othercase, occhars); |
oclength = _pcre_ord2utf8(othercase, occhars); |
1926 |
#endif /* SUPPORT_UCP */ |
#endif /* SUPPORT_UCP */ |
2439 |
for (i = 1; i <= min; i++) |
for (i = 1; i <= min; i++) |
2440 |
{ |
{ |
2441 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
2442 |
prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); |
prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); |
2443 |
if ((*prop_test_variable == prop_test_against) == prop_fail_result) |
if ((*prop_test_variable == prop_test_against) == prop_fail_result) |
2444 |
RRETURN(MATCH_NOMATCH); |
RRETURN(MATCH_NOMATCH); |
2445 |
} |
} |
2453 |
for (i = 1; i <= min; i++) |
for (i = 1; i <= min; i++) |
2454 |
{ |
{ |
2455 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
2456 |
prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); |
prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); |
2457 |
if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); |
if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); |
2458 |
while (eptr < md->end_subject) |
while (eptr < md->end_subject) |
2459 |
{ |
{ |
2462 |
{ |
{ |
2463 |
GETCHARLEN(c, eptr, len); |
GETCHARLEN(c, eptr, len); |
2464 |
} |
} |
2465 |
prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); |
prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); |
2466 |
if (prop_category != ucp_M) break; |
if (prop_category != ucp_M) break; |
2467 |
eptr += len; |
eptr += len; |
2468 |
} |
} |
2632 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
2633 |
if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
2634 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
2635 |
prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); |
prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); |
2636 |
if ((*prop_test_variable == prop_test_against) == prop_fail_result) |
if ((*prop_test_variable == prop_test_against) == prop_fail_result) |
2637 |
RRETURN(MATCH_NOMATCH); |
RRETURN(MATCH_NOMATCH); |
2638 |
} |
} |
2649 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
2650 |
if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
2651 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
2652 |
prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); |
prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); |
2653 |
if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); |
if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); |
2654 |
while (eptr < md->end_subject) |
while (eptr < md->end_subject) |
2655 |
{ |
{ |
2658 |
{ |
{ |
2659 |
GETCHARLEN(c, eptr, len); |
GETCHARLEN(c, eptr, len); |
2660 |
} |
} |
2661 |
prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); |
prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); |
2662 |
if (prop_category != ucp_M) break; |
if (prop_category != ucp_M) break; |
2663 |
eptr += len; |
eptr += len; |
2664 |
} |
} |
2790 |
int len = 1; |
int len = 1; |
2791 |
if (eptr >= md->end_subject) break; |
if (eptr >= md->end_subject) break; |
2792 |
GETCHARLEN(c, eptr, len); |
GETCHARLEN(c, eptr, len); |
2793 |
prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); |
prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); |
2794 |
if ((*prop_test_variable == prop_test_against) == prop_fail_result) |
if ((*prop_test_variable == prop_test_against) == prop_fail_result) |
2795 |
break; |
break; |
2796 |
eptr+= len; |
eptr+= len; |
2816 |
{ |
{ |
2817 |
if (eptr >= md->end_subject) break; |
if (eptr >= md->end_subject) break; |
2818 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
2819 |
prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); |
prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); |
2820 |
if (prop_category == ucp_M) break; |
if (prop_category == ucp_M) break; |
2821 |
while (eptr < md->end_subject) |
while (eptr < md->end_subject) |
2822 |
{ |
{ |
2825 |
{ |
{ |
2826 |
GETCHARLEN(c, eptr, len); |
GETCHARLEN(c, eptr, len); |
2827 |
} |
} |
2828 |
prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); |
prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); |
2829 |
if (prop_category != ucp_M) break; |
if (prop_category != ucp_M) break; |
2830 |
eptr += len; |
eptr += len; |
2831 |
} |
} |
2846 |
{ |
{ |
2847 |
GETCHARLEN(c, eptr, len); |
GETCHARLEN(c, eptr, len); |
2848 |
} |
} |
2849 |
prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); |
prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); |
2850 |
if (prop_category != ucp_M) break; |
if (prop_category != ucp_M) break; |
2851 |
eptr--; |
eptr--; |
2852 |
} |
} |
3200 |
< -1 => some kind of unexpected problem |
< -1 => some kind of unexpected problem |
3201 |
*/ |
*/ |
3202 |
|
|
3203 |
EXPORT int |
PCRE_EXPORT int |
3204 |
pcre_exec(const pcre *argument_re, const pcre_extra *extra_data, |
pcre_exec(const pcre *argument_re, const pcre_extra *extra_data, |
3205 |
const char *subject, int length, int start_offset, int options, int *offsets, |
const char *subject, int length, int start_offset, int options, int *offsets, |
3206 |
int offsetcount) |
int offsetcount) |