• Home
  • Raw
  • Download

Lines Matching refs:status

177 …xt* regextst_openUTF8FromInvariant(UText* ut, const char *inv, int64_t length, UErrorCode *status);
242 #define REGEX_CHECK_STATUS {if (U_FAILURE(status)) {dataerrln("%s:%d: RegexTest failure. status=%s…
243 … __FILE__, __LINE__, u_errorName(status)); return;}}
247 #define REGEX_ASSERT_FAIL(expr, errcode) {UErrorCode status=U_ZERO_ERROR; (expr);\
248 if (status!=errcode) {dataerrln("RegexTest failure at line %d. Expected status=%s, got %s", \
249 __LINE__, u_errorName(errcode), u_errorName(status));};}
251 #define REGEX_CHECK_STATUS_L(line) {if (U_FAILURE(status)) {errln( \
252 "RegexTest failure at line %d, from %d. status=%d\n",__LINE__, (line), status); }}
285 UErrorCode status = U_ZERO_ERROR; in assertUText() local
287 utext_openUTF8(&expectedText, expected, -1, &status); in assertUText()
288 if(U_FAILURE(status)) { in assertUText()
289 …s calling utext_openUTF8(expected: %d chars)\n", file, line, u_errorName(status), strlen(expected)… in assertUText()
311 UErrorCode status = U_ZERO_ERROR; in assertUTextInvariant() local
313 regextst_openUTF8FromInvariant(&expectedText, expected, -1, &status); in assertUTextInvariant()
314 if(U_FAILURE(status)) { in assertUTextInvariant()
315 …st_openUTF8FromInvariant(expected: %d chars)\n", file, line, u_errorName(status), strlen(expected)… in assertUTextInvariant()
352 …t* regextst_openUTF8FromInvariant(UText *ut, const char *inv, int64_t length, UErrorCode *status) { in regextst_openUTF8FromInvariant() argument
356 return utext_openUTF8(ut, inv, length, status); in regextst_openUTF8FromInvariant()
361 *status = U_MEMORY_ALLOCATION_ERROR; in regextst_openUTF8FromInvariant()
373 return utext_openUTF8(ut, (const char*)buf, length, status); in regextst_openUTF8FromInvariant()
397 UErrorCode status = U_ZERO_ERROR; in doRegexLMTest() local
404 REPattern = RegexPattern::compile(patString, 0, pe, status); in doRegexLMTest()
405 if (U_FAILURE(status)) { in doRegexLMTest()
407 line, u_errorName(status)); in doRegexLMTest()
414 REMatcher = REPattern->matcher(unEscapedInput, status); in doRegexLMTest()
415 if (U_FAILURE(status)) { in doRegexLMTest()
417 line, u_errorName(status)); in doRegexLMTest()
422 actualmatch = REMatcher->lookingAt(status); in doRegexLMTest()
423 if (U_FAILURE(status)) { in doRegexLMTest()
425 line, u_errorName(status)); in doRegexLMTest()
433 status = U_ZERO_ERROR; in doRegexLMTest()
434 actualmatch = REMatcher->matches(status); in doRegexLMTest()
435 if (U_FAILURE(status)) { in doRegexLMTest()
437 line, u_errorName(status)); in doRegexLMTest()
460 UErrorCode status = U_ZERO_ERROR; in doRegexLMTestUTF8() local
466 regextst_openUTF8FromInvariant(&pattern, pat, -1, &status); in doRegexLMTestUTF8()
467 REPattern = RegexPattern::compile(&pattern, 0, pe, status); in doRegexLMTestUTF8()
468 if (U_FAILURE(status)) { in doRegexLMTestUTF8()
470 line, u_errorName(status)); in doRegexLMTestUTF8()
476 LocalUConverterPointer UTF8Converter(ucnv_open("UTF8", &status)); in doRegexLMTestUTF8()
477 …v_setFromUCallBack(UTF8Converter.getAlias(), UCNV_FROM_U_CALLBACK_STOP, NULL, NULL, NULL, &status); in doRegexLMTestUTF8()
479 inputUTF8Length = unEscapedInput.extract(NULL, 0, UTF8Converter.getAlias(), status); in doRegexLMTestUTF8()
480 if (U_FAILURE(status) && status != U_BUFFER_OVERFLOW_ERROR) { in doRegexLMTestUTF8()
482 …"RegexTest unable to convert input to UTF8 at line %d. Status = %s\n", line, u_errorName(status)); in doRegexLMTestUTF8()
485 status = U_ZERO_ERROR; // buffer overflow in doRegexLMTestUTF8()
487 unEscapedInput.extract(textChars, inputUTF8Length+1, UTF8Converter.getAlias(), status); in doRegexLMTestUTF8()
488 utext_openUTF8(&inputText, textChars, inputUTF8Length, &status); in doRegexLMTestUTF8()
490 REMatcher = &REPattern->matcher(status)->reset(&inputText); in doRegexLMTestUTF8()
491 if (U_FAILURE(status)) { in doRegexLMTestUTF8()
493 line, u_errorName(status)); in doRegexLMTestUTF8()
498 actualmatch = REMatcher->lookingAt(status); in doRegexLMTestUTF8()
499 if (U_FAILURE(status)) { in doRegexLMTestUTF8()
501 line, u_errorName(status)); in doRegexLMTestUTF8()
509 status = U_ZERO_ERROR; in doRegexLMTestUTF8()
510 actualmatch = REMatcher->matches(status); in doRegexLMTestUTF8()
511 if (U_FAILURE(status)) { in doRegexLMTestUTF8()
513 line, u_errorName(status)); in doRegexLMTestUTF8()
544 #define REGEX_ERR(pat, line, col, status) regex_err(pat, line, col, status, __LINE__); argument
550 UErrorCode status = U_ZERO_ERROR; in regex_err() local
558 callerPattern = RegexPattern::compile(patString, 0, pe, status); in regex_err()
559 if (status != expectedStatus) { in regex_err()
560 dataerrln("Line %d: unexpected error %s compiling pattern.", line, u_errorName(status)); in regex_err()
562 if (status != U_ZERO_ERROR) { in regex_err()
576 regextst_openUTF8FromInvariant(&patternText, pat, -1, &status); in regex_err()
577 callerPattern = RegexPattern::compile(&patternText, 0, pe, status); in regex_err()
578 if (status != expectedStatus) { in regex_err()
579 dataerrln("Line %d: unexpected error %s compiling pattern.", line, u_errorName(status)); in regex_err()
581 if (status != U_ZERO_ERROR) { in regex_err()
612 UErrorCode status = U_ZERO_ERROR; in Basic()
614 …ttern::compile(UNICODE_STRING_SIMPLE("a\\u00dfx").unescape(), UREGEX_CASE_INSENSITIVE, pe, status); in Basic()
616 … RegexMatcher *m = pattern->matcher(UNICODE_STRING_SIMPLE("a\\u00dfxzzz").unescape(), status); in Basic()
758 UErrorCode status = U_ZERO_ERROR; in UTextBasic() local
760 utext_openUTF8(&pattern, str_abc, -1, &status); in UTextBasic()
761 RegexMatcher matcher(&pattern, 0, status); in UTextBasic()
765 utext_openUTF8(&input, str_abc, -1, &status); in UTextBasic()
789 UErrorCode status=U_ZERO_ERROR; in API_Match() local
807 pat2 = RegexPattern::compile(re, flags, pe, status); in API_Match()
818 RegexMatcher *m1 = pat2->matcher(inStr1, status); in API_Match()
820 REGEX_ASSERT(m1->lookingAt(status) == TRUE); in API_Match()
823 REGEX_ASSERT(m1->lookingAt(status) == FALSE); in API_Match()
827 REGEX_ASSERT(m1->lookingAt(status) == TRUE); in API_Match()
829 REGEX_ASSERT(m1->lookingAt(status) == FALSE); in API_Match()
837 m1->reset(4, status); in API_Match()
840 REGEX_ASSERT(m1->lookingAt(status) == TRUE); in API_Match()
842 m1->reset(-1, status); in API_Match()
843 REGEX_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in API_Match()
844 status = U_ZERO_ERROR; in API_Match()
846 m1->reset(0, status); in API_Match()
848 status = U_ZERO_ERROR; in API_Match()
851 m1->reset(len-1, status); in API_Match()
853 status = U_ZERO_ERROR; in API_Match()
855 m1->reset(len, status); in API_Match()
857 status = U_ZERO_ERROR; in API_Match()
859 m1->reset(len+1, status); in API_Match()
860 REGEX_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in API_Match()
861 status = U_ZERO_ERROR; in API_Match()
867 REGEX_ASSERT(m1->matches(4, status) == TRUE); in API_Match()
869 REGEX_ASSERT(m1->matches(3, status) == FALSE); in API_Match()
871 REGEX_ASSERT(m1->matches(5, status) == FALSE); in API_Match()
872 REGEX_ASSERT(m1->matches(4, status) == TRUE); in API_Match()
873 REGEX_ASSERT(m1->matches(-1, status) == FALSE); in API_Match()
874 REGEX_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in API_Match()
878 status = U_ZERO_ERROR; in API_Match()
880 REGEX_ASSERT(m1->matches(len, status) == FALSE); in API_Match()
884 status = U_ZERO_ERROR; in API_Match()
885 REGEX_ASSERT(m1->matches(len+1, status) == FALSE); in API_Match()
886 REGEX_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in API_Match()
890 status = U_ZERO_ERROR; in API_Match()
891 RegexMatcher m("A?", 0, status); // will match zero length string. in API_Match()
895 REGEX_ASSERT(m.matches(len, status) == TRUE); in API_Match()
898 REGEX_ASSERT(m.matches(0, status) == TRUE); in API_Match()
906 status = U_ZERO_ERROR; in API_Match()
908 REGEX_ASSERT(m1->lookingAt(4, status) == TRUE); in API_Match()
909 REGEX_ASSERT(m1->lookingAt(5, status) == FALSE); in API_Match()
910 REGEX_ASSERT(m1->lookingAt(3, status) == FALSE); in API_Match()
911 REGEX_ASSERT(m1->lookingAt(4, status) == TRUE); in API_Match()
912 REGEX_ASSERT(m1->lookingAt(-1, status) == FALSE); in API_Match()
913 REGEX_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in API_Match()
914 status = U_ZERO_ERROR; in API_Match()
916 REGEX_ASSERT(m1->lookingAt(len, status) == FALSE); in API_Match()
918 REGEX_ASSERT(m1->lookingAt(len+1, status) == FALSE); in API_Match()
919 REGEX_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in API_Match()
935 UErrorCode status=U_ZERO_ERROR; in API_Match() local
938 RegexPattern *pat = RegexPattern::compile(re, flags, pe, status); in API_Match()
942 RegexMatcher *matcher = pat->matcher(data, status); in API_Match()
944 REGEX_ASSERT(matcher->lookingAt(status) == TRUE); in API_Match()
949 int32_t actualStart = matcher->start(i, status); in API_Match()
955 int32_t actualEnd = matcher->end(i, status); in API_Match()
963 REGEX_ASSERT(matcher->start(0, status) == matcher->start(status)); in API_Match()
964 REGEX_ASSERT(matcher->end(0, status) == matcher->end(status)); in API_Match()
966 REGEX_ASSERT_FAIL(matcher->start(-1, status), U_INDEX_OUTOFBOUNDS_ERROR); in API_Match()
967 REGEX_ASSERT_FAIL(matcher->start( 4, status), U_INDEX_OUTOFBOUNDS_ERROR); in API_Match()
969 REGEX_ASSERT_FAIL(matcher->start( 0, status), U_REGEX_INVALID_STATE); in API_Match()
971 matcher->lookingAt(status); in API_Match()
972 REGEX_ASSERT(matcher->group(status) == "0123456789"); in API_Match()
973 REGEX_ASSERT(matcher->group(0, status) == "0123456789"); in API_Match()
974 REGEX_ASSERT(matcher->group(1, status) == "234567" ); in API_Match()
975 REGEX_ASSERT(matcher->group(2, status) == "45" ); in API_Match()
976 REGEX_ASSERT(matcher->group(3, status) == "89" ); in API_Match()
978 REGEX_ASSERT_FAIL(matcher->group(-1, status), U_INDEX_OUTOFBOUNDS_ERROR); in API_Match()
979 REGEX_ASSERT_FAIL(matcher->group( 4, status), U_INDEX_OUTOFBOUNDS_ERROR); in API_Match()
981 REGEX_ASSERT_FAIL(matcher->group( 0, status), U_REGEX_INVALID_STATE); in API_Match()
994 UErrorCode status=U_ZERO_ERROR; in API_Match() local
997 RegexPattern *pat = RegexPattern::compile(re, flags, pe, status); in API_Match()
1002 RegexMatcher *matcher = pat->matcher(data, status); in API_Match()
1005 REGEX_ASSERT(matcher->start(status) == 1); in API_Match()
1007 REGEX_ASSERT(matcher->start(status) == 6); in API_Match()
1009 REGEX_ASSERT(matcher->start(status) == 12); in API_Match()
1015 REGEX_ASSERT(matcher->start(status) == 1); in API_Match()
1017 REGEX_ASSERT(matcher->find(0, status)); in API_Match()
1018 REGEX_ASSERT(matcher->start(status) == 1); in API_Match()
1019 REGEX_ASSERT(matcher->find(1, status)); in API_Match()
1020 REGEX_ASSERT(matcher->start(status) == 1); in API_Match()
1021 REGEX_ASSERT(matcher->find(2, status)); in API_Match()
1022 REGEX_ASSERT(matcher->start(status) == 6); in API_Match()
1023 REGEX_ASSERT(matcher->find(12, status)); in API_Match()
1024 REGEX_ASSERT(matcher->start(status) == 12); in API_Match()
1025 REGEX_ASSERT(matcher->find(13, status) == FALSE); in API_Match()
1026 REGEX_ASSERT(matcher->find(16, status) == FALSE); in API_Match()
1027 REGEX_ASSERT(matcher->find(17, status) == FALSE); in API_Match()
1028 REGEX_ASSERT_FAIL(matcher->start(status), U_REGEX_INVALID_STATE); in API_Match()
1030 status = U_ZERO_ERROR; in API_Match()
1031 REGEX_ASSERT_FAIL(matcher->find(-1, status), U_INDEX_OUTOFBOUNDS_ERROR); in API_Match()
1032 status = U_ZERO_ERROR; in API_Match()
1033 REGEX_ASSERT_FAIL(matcher->find(18, status), U_INDEX_OUTOFBOUNDS_ERROR); in API_Match()
1048 UErrorCode status=U_ZERO_ERROR; in API_Match() local
1051 RegexPattern *pat = RegexPattern::compile(re, flags, pe, status); in API_Match()
1056 RegexMatcher *matcher = pat->matcher(data, status); in API_Match()
1059 REGEX_ASSERT(matcher->start(status) == 0); in API_Match()
1060 REGEX_ASSERT(matcher->start(1, status) == -1); in API_Match()
1061 REGEX_ASSERT(matcher->start(2, status) == 1); in API_Match()
1064 REGEX_ASSERT(matcher->start(status) == 4); in API_Match()
1065 REGEX_ASSERT(matcher->start(1, status) == 4); in API_Match()
1066 REGEX_ASSERT(matcher->start(2, status) == -1); in API_Match()
1079 UErrorCode status=U_ZERO_ERROR; in API_Match() local
1080 … RegexMatcher m("(?= ?)", 0, status); // This pattern will zero-length matches anywhere, in API_Match()
1089 REGEX_ASSERT(m.start(status) == i); in API_Match()
1090 REGEX_ASSERT(m.end(status) == i); in API_Match()
1102 REGEX_ASSERT(m.start(status) == i); in API_Match()
1103 REGEX_ASSERT(m.end(status) == i); in API_Match()
1112 UErrorCode status=U_ZERO_ERROR; in API_Match() local
1113 RegexMatcher m(".?", 0, status); in API_Match()
1121 REGEX_ASSERT(m.start(status) == i); in API_Match()
1122 REGEX_ASSERT(m.end(status) == (i<4 ? i+1 : i)); in API_Match()
1133 UErrorCode status = U_ZERO_ERROR; in API_Match() local
1134 RegexMatcher m(".?", 0, status); in API_Match()
1137 REGEX_ASSERT(m.start(status) == 0); in API_Match()
1141 UErrorCode status = U_ZERO_ERROR; in API_Match() local
1142 RegexPattern *p = RegexPattern::compile(".", 0, status); in API_Match()
1143 RegexMatcher *m = p->matcher(status); in API_Match()
1156 UErrorCode status = U_ZERO_ERROR; in API_Match() local
1158 RegexMatcher m(".*", testString, 0, status); in API_Match()
1165 m.region(2,4, status); in API_Match()
1167 REGEX_ASSERT(m.matches(status)); in API_Match()
1168 REGEX_ASSERT(m.start(status)==2); in API_Match()
1169 REGEX_ASSERT(m.end(status)==4); in API_Match()
1209 UErrorCode status = U_ZERO_ERROR; in API_Match() local
1211 RegexMatcher m1(".*", testString, 0, status); in API_Match()
1212 REGEX_ASSERT(m1.lookingAt(status) == TRUE); in API_Match()
1217 status = U_ZERO_ERROR; in API_Match()
1218 RegexMatcher m2("a*", testString, 0, status); in API_Match()
1219 REGEX_ASSERT(m2.lookingAt(status) == TRUE); in API_Match()
1224 status = U_ZERO_ERROR; in API_Match()
1225 RegexMatcher m3(".*$", testString, 0, status); in API_Match()
1226 REGEX_ASSERT(m3.lookingAt(status) == TRUE); in API_Match()
1241 UErrorCode status = U_ZERO_ERROR; in API_Match()
1243 RegexMatcher m(".", 0, status); in API_Match()
1246 RegexPattern *p = RegexPattern::compile(".", 0, status); in API_Match()
1247 RegexMatcher *m2 = p->matcher(ucharString, status); // should not compile. in API_Match()
1249 RegexMatcher m3(".", ucharString, 0, status); // Should not compile in API_Match()
1260 UErrorCode status = U_ZERO_ERROR; in API_Match() local
1264 RegexMatcher matcher("(a+)+b", testString, 0, status); in API_Match()
1267 matcher.setTimeLimit(100, status); in API_Match()
1269 REGEX_ASSERT(matcher.lookingAt(status) == FALSE); in API_Match()
1270 REGEX_ASSERT(status == U_REGEX_TIME_OUT); in API_Match()
1273 UErrorCode status = U_ZERO_ERROR; in API_Match() local
1276 RegexMatcher matcher("(a+)+b", testString, 0, status); in API_Match()
1278 matcher.setTimeLimit(100, status); in API_Match()
1279 REGEX_ASSERT(matcher.lookingAt(status) == FALSE); in API_Match()
1287 UErrorCode status = U_ZERO_ERROR; in API_Match() local
1292 RegexMatcher matcher("(A)+A$", testString, 0, status); in API_Match()
1295 REGEX_ASSERT(matcher.lookingAt(status) == FALSE); in API_Match()
1296 REGEX_ASSERT(status == U_REGEX_STACK_OVERFLOW); in API_Match()
1299 status = U_ZERO_ERROR; in API_Match()
1300 matcher.setStackLimit(0, status); in API_Match()
1302 REGEX_ASSERT(matcher.lookingAt(status) == TRUE); in API_Match()
1307 status = U_ZERO_ERROR; in API_Match()
1308 matcher.setStackLimit(10000, status); in API_Match()
1309 REGEX_ASSERT(matcher.lookingAt(status) == FALSE); in API_Match()
1310 REGEX_ASSERT(status == U_REGEX_STACK_OVERFLOW); in API_Match()
1317 UErrorCode status = U_ZERO_ERROR; in API_Match() local
1319 RegexMatcher matcher("abc", testString, 0, status); in API_Match()
1321 matcher.setStackLimit(30, status); in API_Match()
1323 REGEX_ASSERT(matcher.matches(status) == TRUE); in API_Match()
1328 status = U_ZERO_ERROR; in API_Match()
1329 matcher.setStackLimit(1000, status); in API_Match()
1331 matcher.setStackLimit(-1, status); in API_Match()
1332 REGEX_ASSERT(status == U_ILLEGAL_ARGUMENT_ERROR); in API_Match()
1356 UErrorCode status=U_ZERO_ERROR; in API_Replace() local
1359 RegexPattern *pat = RegexPattern::compile(re, flags, pe, status); in API_Replace()
1363 RegexMatcher *matcher = pat->matcher(data, status); in API_Replace()
1369 dest = matcher->replaceFirst("yz", status); in API_Replace()
1373 dest = matcher->replaceAll("yz", status); in API_Replace()
1382 dest = matcher->replaceFirst("yz", status); in API_Replace()
1386 dest = matcher->replaceAll("yz", status); in API_Replace()
1395 dest = matcher->replaceFirst("yz", status); in API_Replace()
1399 dest = matcher->replaceAll("yz", status); in API_Replace()
1407 dest = matcher->replaceFirst("", status); in API_Replace()
1411 dest = matcher->replaceAll("", status); in API_Replace()
1420 dest = matcher->replaceFirst("xyz", status); in API_Replace()
1424 dest = matcher->replaceAll("xyz", status); in API_Replace()
1432 RegexPattern *pat2 = RegexPattern::compile(re2, flags, pe, status); in API_Replace()
1435 RegexMatcher *matcher2 = pat2->matcher(d5, status); in API_Replace()
1437 dest = matcher2->replaceFirst("$1$1", status); in API_Replace()
1441 dest = matcher2->replaceFirst(UNICODE_STRING_SIMPLE("The value of \\$1 is $1."), status); in API_Replace()
1445 dest = matcher2->replaceFirst("$ by itself, no group number $$$", status); in API_Replace()
1446 REGEX_ASSERT(U_FAILURE(status)); in API_Replace()
1447 status = U_ZERO_ERROR; in API_Replace()
1451 dest = matcher2->replaceFirst(replacement, status); in API_Replace()
1455 …REGEX_ASSERT_FAIL(matcher2->replaceFirst("bad capture group number $5...",status), U_INDEX_OUTOFBO… in API_Replace()
1465 UnicodeString result = matcher->replaceAll(substitute, status); in API_Replace()
1473 UnicodeString result = matcher->replaceAll(substitute, status); in API_Replace()
1485 status = U_ZERO_ERROR; in API_Replace()
1487 RegexMatcher m("ss(.*?)ee", 0, status); in API_Replace()
1495 m.appendReplacement(result, "ooh", status); in API_Replace()
1500 status = U_ZERO_ERROR; in API_Replace()
1502 m.reset(10, status); in API_Replace()
1505 m.appendReplacement(result, "ooh", status); in API_Replace()
1510 status = U_ZERO_ERROR; in API_Replace()
1513 m.find(10, status); in API_Replace()
1515 m.appendReplacement(result, "ooh", status); in API_Replace()
1546 UErrorCode status = U_ZERO_ERROR; in API_Pattern() local
1549 RegexPattern *pat1 = RegexPattern::compile(re1, 0, pe, status); in API_Pattern()
1550 RegexPattern *pat2 = RegexPattern::compile(re2, 0, pe, status); in API_Pattern()
1569 RegexPattern *pat1a = RegexPattern::compile(re1, pe, status); in API_Pattern()
1575 RegexPattern *pat1b = RegexPattern::compile(re1, UREGEX_CASE_INSENSITIVE, pe, status); in API_Pattern()
1599 UErrorCode status = U_ZERO_ERROR; in API_Pattern() local
1600 … RegexPattern *pSource = RegexPattern::compile(UNICODE_STRING_SIMPLE("\\p{L}+"), 0, status); in API_Pattern()
1603 RegexMatcher *mFromClone = pClone->matcher(status); in API_Pattern()
1608 REGEX_ASSERT(mFromClone->group(status) == "Hello"); in API_Pattern()
1610 REGEX_ASSERT(mFromClone->group(status) == "World"); in API_Pattern()
1619 REGEX_ASSERT(RegexPattern::matches(".*", "random input", pe, status) == TRUE); in API_Pattern()
1621 REGEX_ASSERT(RegexPattern::matches("abc", "random input", pe, status) == FALSE); in API_Pattern()
1623 REGEX_ASSERT(RegexPattern::matches(".*nput", "random input", pe, status) == TRUE); in API_Pattern()
1625 REGEX_ASSERT(RegexPattern::matches("random input", "random input", pe, status) == TRUE); in API_Pattern()
1627 REGEX_ASSERT(RegexPattern::matches(".*u", "random input", pe, status) == FALSE); in API_Pattern()
1629 status = U_INDEX_OUTOFBOUNDS_ERROR; in API_Pattern()
1630 REGEX_ASSERT(RegexPattern::matches("abc", "abc", pe, status) == FALSE); in API_Pattern()
1631 REGEX_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in API_Pattern()
1637 status = U_ZERO_ERROR; in API_Pattern()
1638 pat1 = RegexPattern::compile(" +", pe, status); in API_Pattern()
1643 n = pat1->split("Now is the time", fields, 10, status); in API_Pattern()
1652 n = pat1->split("Now is the time", fields, 2, status); in API_Pattern()
1660 status = U_ZERO_ERROR; in API_Pattern()
1661 n = pat1->split("Now is the time", fields, 1, status); in API_Pattern()
1666 status = U_ZERO_ERROR; in API_Pattern()
1668 n = pat1->split(" Now is the time ", fields, 10, status); in API_Pattern()
1678 n = pat1->split(" ", fields, 10, status); in API_Pattern()
1685 n = pat1->split("", fields, 10, status); in API_Pattern()
1693 pat1 = RegexPattern::compile(UNICODE_STRING_SIMPLE("<(\\w*)>"), pe, status); in API_Pattern()
1696 status = U_ZERO_ERROR; in API_Pattern()
1697 n = pat1->split("<a>Now is <b>the time<c>", fields, 10, status); in API_Pattern()
1707 REGEX_ASSERT(status==U_ZERO_ERROR); in API_Pattern()
1709 n = pat1->split(" <a>Now is <b>the time<c>", fields, 10, status); in API_Pattern()
1720 status = U_ZERO_ERROR; in API_Pattern()
1722 n = pat1->split(" <a>Now is <b>the time<c>", fields, 6, status); in API_Pattern()
1733 status = U_ZERO_ERROR; in API_Pattern()
1735 n = pat1->split(" <a>Now is <b>the time<c>", fields, 5, status); in API_Pattern()
1745 status = U_ZERO_ERROR; in API_Pattern()
1747 n = pat1->split(" <a>Now is <b>the time", fields, 5, status); in API_Pattern()
1757 status = U_ZERO_ERROR; in API_Pattern()
1758 n = pat1->split(" <a>Now is <b>the time<c>", fields, 4, status); in API_Pattern()
1765 status = U_ZERO_ERROR; in API_Pattern()
1768 pat1 = RegexPattern::compile("([-,])", pe, status); in API_Pattern()
1770 n = pat1->split("1-10,20", fields, 10, status); in API_Pattern()
1781 pat1 = RegexPattern::compile(",", pe, status); in API_Pattern()
1783 n = pat1->split("a,b,c,", fields, 10, status); in API_Pattern()
1791 n = pat1->split("a,,,", fields, 10, status); in API_Pattern()
1801 pat1 = RegexPattern::compile(":?", pe, status); in API_Pattern()
1803 n = pat1->split("abc", fields, 10, status); in API_Pattern()
1821 pat1 = RegexPattern::compile("(Hello, world)*", pe, status); in API_Pattern()
1830 pat1 = RegexPattern::compile("(Hello, world)*", pe, status); in API_Pattern()
1835 RegexMatcher *m = pat1->matcher(Hello, status); in API_Pattern()
1853 UErrorCode status=U_ZERO_ERROR; in API_Match_UTF8() local
1870 regextst_openUTF8FromInvariant(&re, "abc", -1, &status); in API_Match_UTF8()
1873 pat2 = RegexPattern::compile(&re, flags, pe, status); in API_Match_UTF8()
1879 regextst_openUTF8FromInvariant(&input1, "abcdef this is a test", -1, &status); in API_Match_UTF8()
1881 regextst_openUTF8FromInvariant(&input2, "not abc", -1, &status); in API_Match_UTF8()
1883 utext_openUChars(&empty, NULL, 0, &status); in API_Match_UTF8()
1892 RegexMatcher *m1 = &pat2->matcher(status)->reset(&input1); in API_Match_UTF8()
1894 REGEX_ASSERT(m1->lookingAt(status) == TRUE); in API_Match_UTF8()
1898 REGEX_ASSERT(m1->lookingAt(status) == FALSE); in API_Match_UTF8()
1903 REGEX_ASSERT(m1->lookingAt(status) == TRUE); in API_Match_UTF8()
1905 REGEX_ASSERT(m1->lookingAt(status) == FALSE); in API_Match_UTF8()
1912 m1->reset(4, status); in API_Match_UTF8()
1915 REGEX_ASSERT(m1->lookingAt(status) == TRUE); in API_Match_UTF8()
1917 m1->reset(-1, status); in API_Match_UTF8()
1918 REGEX_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in API_Match_UTF8()
1919 status = U_ZERO_ERROR; in API_Match_UTF8()
1921 m1->reset(0, status); in API_Match_UTF8()
1923 status = U_ZERO_ERROR; in API_Match_UTF8()
1925 m1->reset(input1Len-1, status); in API_Match_UTF8()
1927 status = U_ZERO_ERROR; in API_Match_UTF8()
1929 m1->reset(input1Len, status); in API_Match_UTF8()
1931 status = U_ZERO_ERROR; in API_Match_UTF8()
1933 m1->reset(input1Len+1, status); in API_Match_UTF8()
1934 REGEX_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in API_Match_UTF8()
1935 status = U_ZERO_ERROR; in API_Match_UTF8()
1941 REGEX_ASSERT(m1->matches(4, status) == TRUE); in API_Match_UTF8()
1943 REGEX_ASSERT(m1->matches(3, status) == FALSE); in API_Match_UTF8()
1945 REGEX_ASSERT(m1->matches(5, status) == FALSE); in API_Match_UTF8()
1946 REGEX_ASSERT(m1->matches(4, status) == TRUE); in API_Match_UTF8()
1947 REGEX_ASSERT(m1->matches(-1, status) == FALSE); in API_Match_UTF8()
1948 REGEX_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in API_Match_UTF8()
1952 status = U_ZERO_ERROR; in API_Match_UTF8()
1953 REGEX_ASSERT(m1->matches(input2Len, status) == FALSE); in API_Match_UTF8()
1957 status = U_ZERO_ERROR; in API_Match_UTF8()
1958 REGEX_ASSERT(m1->matches(input2Len+1, status) == FALSE); in API_Match_UTF8()
1959 REGEX_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in API_Match_UTF8()
1963 status = U_ZERO_ERROR; in API_Match_UTF8()
1964 RegexMatcher m("A?", 0, status); // will match zero length string. in API_Match_UTF8()
1967 REGEX_ASSERT(m.matches(input1Len, status) == TRUE); in API_Match_UTF8()
1970 REGEX_ASSERT(m.matches(0, status) == TRUE); in API_Match_UTF8()
1978 status = U_ZERO_ERROR; in API_Match_UTF8()
1980 REGEX_ASSERT(m1->lookingAt(4, status) == TRUE); in API_Match_UTF8()
1981 REGEX_ASSERT(m1->lookingAt(5, status) == FALSE); in API_Match_UTF8()
1982 REGEX_ASSERT(m1->lookingAt(3, status) == FALSE); in API_Match_UTF8()
1983 REGEX_ASSERT(m1->lookingAt(4, status) == TRUE); in API_Match_UTF8()
1984 REGEX_ASSERT(m1->lookingAt(-1, status) == FALSE); in API_Match_UTF8()
1985 REGEX_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in API_Match_UTF8()
1986 status = U_ZERO_ERROR; in API_Match_UTF8()
1987 REGEX_ASSERT(m1->lookingAt(input2Len, status) == FALSE); in API_Match_UTF8()
1989 REGEX_ASSERT(m1->lookingAt(input2Len+1, status) == FALSE); in API_Match_UTF8()
1990 REGEX_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in API_Match_UTF8()
2011 UErrorCode status=U_ZERO_ERROR; in API_Match_UTF8() local
2014 utext_openUTF8(&re, str_01234567_pat, -1, &status); in API_Match_UTF8()
2016 RegexPattern *pat = RegexPattern::compile(&re, flags, pe, status); in API_Match_UTF8()
2021 utext_openUTF8(&input, str_0123456789, -1, &status); in API_Match_UTF8()
2023 RegexMatcher *matcher = &pat->matcher(status)->reset(&input); in API_Match_UTF8()
2025 REGEX_ASSERT(matcher->lookingAt(status) == TRUE); in API_Match_UTF8()
2030 int32_t actualStart = matcher->start(i, status); in API_Match_UTF8()
2036 int32_t actualEnd = matcher->end(i, status); in API_Match_UTF8()
2044 REGEX_ASSERT(matcher->start(0, status) == matcher->start(status)); in API_Match_UTF8()
2045 REGEX_ASSERT(matcher->end(0, status) == matcher->end(status)); in API_Match_UTF8()
2047 REGEX_ASSERT_FAIL(matcher->start(-1, status), U_INDEX_OUTOFBOUNDS_ERROR); in API_Match_UTF8()
2048 REGEX_ASSERT_FAIL(matcher->start( 4, status), U_INDEX_OUTOFBOUNDS_ERROR); in API_Match_UTF8()
2050 REGEX_ASSERT_FAIL(matcher->start( 0, status), U_REGEX_INVALID_STATE); in API_Match_UTF8()
2052 matcher->lookingAt(status); in API_Match_UTF8()
2056 utext_openUnicodeString(&destText, &dest, &status); in API_Match_UTF8()
2061 result = matcher->group((UText *)NULL, group_len, status); in API_Match_UTF8()
2065 result = matcher->group(0, &destText, group_len, status); in API_Match_UTF8()
2071 utext_openUnicodeString(&destText, &dest, &status); in API_Match_UTF8()
2074 result = matcher->group(0, NULL, length, status); in API_Match_UTF8()
2078 result = matcher->group(0, &destText, length, status); in API_Match_UTF8()
2086 result = matcher->group(1, NULL, length, status); in API_Match_UTF8()
2093 result = matcher->group(1, &destText, length, status); in API_Match_UTF8()
2102 result = matcher->group(2, NULL, length, status); in API_Match_UTF8()
2109 result = matcher->group(2, &destText, length, status); in API_Match_UTF8()
2118 result = matcher->group(3, NULL, length, status); in API_Match_UTF8()
2125 result = matcher->group(3, &destText, length, status); in API_Match_UTF8()
2134 status = U_ZERO_ERROR; in API_Match_UTF8()
2135 REGEX_ASSERT_FAIL(matcher->group(-1, status), U_INDEX_OUTOFBOUNDS_ERROR); in API_Match_UTF8()
2136 status = U_ZERO_ERROR; in API_Match_UTF8()
2137 REGEX_ASSERT_FAIL(matcher->group( 4, status), U_INDEX_OUTOFBOUNDS_ERROR); in API_Match_UTF8()
2138 status = U_ZERO_ERROR; in API_Match_UTF8()
2140 REGEX_ASSERT_FAIL(matcher->group( 0, status), U_REGEX_INVALID_STATE); in API_Match_UTF8()
2156 UErrorCode status=U_ZERO_ERROR; in API_Match_UTF8() local
2159 utext_openUTF8(&re, str_abc, -1, &status); in API_Match_UTF8()
2161 RegexPattern *pat = RegexPattern::compile(&re, flags, pe, status); in API_Match_UTF8()
2165 utext_openUTF8(&input, str_abcabcabc, -1, &status); in API_Match_UTF8()
2168 RegexMatcher *matcher = &pat->matcher(status)->reset(&input); in API_Match_UTF8()
2171 REGEX_ASSERT(matcher->start(status) == 1); in API_Match_UTF8()
2173 REGEX_ASSERT(matcher->start(status) == 6); in API_Match_UTF8()
2175 REGEX_ASSERT(matcher->start(status) == 12); in API_Match_UTF8()
2181 REGEX_ASSERT(matcher->start(status) == 1); in API_Match_UTF8()
2183 REGEX_ASSERT(matcher->find(0, status)); in API_Match_UTF8()
2184 REGEX_ASSERT(matcher->start(status) == 1); in API_Match_UTF8()
2185 REGEX_ASSERT(matcher->find(1, status)); in API_Match_UTF8()
2186 REGEX_ASSERT(matcher->start(status) == 1); in API_Match_UTF8()
2187 REGEX_ASSERT(matcher->find(2, status)); in API_Match_UTF8()
2188 REGEX_ASSERT(matcher->start(status) == 6); in API_Match_UTF8()
2189 REGEX_ASSERT(matcher->find(12, status)); in API_Match_UTF8()
2190 REGEX_ASSERT(matcher->start(status) == 12); in API_Match_UTF8()
2191 REGEX_ASSERT(matcher->find(13, status) == FALSE); in API_Match_UTF8()
2192 REGEX_ASSERT(matcher->find(16, status) == FALSE); in API_Match_UTF8()
2193 REGEX_ASSERT(matcher->find(17, status) == FALSE); in API_Match_UTF8()
2194 REGEX_ASSERT_FAIL(matcher->start(status), U_REGEX_INVALID_STATE); in API_Match_UTF8()
2196 status = U_ZERO_ERROR; in API_Match_UTF8()
2197 REGEX_ASSERT_FAIL(matcher->find(-1, status), U_INDEX_OUTOFBOUNDS_ERROR); in API_Match_UTF8()
2198 status = U_ZERO_ERROR; in API_Match_UTF8()
2199 REGEX_ASSERT_FAIL(matcher->find(18, status), U_INDEX_OUTOFBOUNDS_ERROR); in API_Match_UTF8()
2217 UErrorCode status=U_ZERO_ERROR; in API_Match_UTF8() local
2220 utext_openUTF8(&re, str_Gabcabc, -1, &status); in API_Match_UTF8()
2222 RegexPattern *pat = RegexPattern::compile(&re, flags, pe, status); in API_Match_UTF8()
2227 utext_openUTF8(&input, str_abcabcabc, -1, &status); in API_Match_UTF8()
2230 RegexMatcher *matcher = &pat->matcher(status)->reset(&input); in API_Match_UTF8()
2233 REGEX_ASSERT(matcher->start(status) == 0); in API_Match_UTF8()
2234 REGEX_ASSERT(matcher->start(1, status) == -1); in API_Match_UTF8()
2235 REGEX_ASSERT(matcher->start(2, status) == 1); in API_Match_UTF8()
2238 REGEX_ASSERT(matcher->start(status) == 4); in API_Match_UTF8()
2239 REGEX_ASSERT(matcher->start(1, status) == 4); in API_Match_UTF8()
2240 REGEX_ASSERT(matcher->start(2, status) == -1); in API_Match_UTF8()
2256 UErrorCode status=U_ZERO_ERROR; in API_Match_UTF8() local
2257 … RegexMatcher m("(?= ?)", 0, status); // This pattern will zero-length matches anywhere, in API_Match_UTF8()
2261 utext_openUTF8(&s, " ", -1, &status); in API_Match_UTF8()
2267 REGEX_ASSERT(m.start(status) == i); in API_Match_UTF8()
2268 REGEX_ASSERT(m.end(status) == i); in API_Match_UTF8()
2275 utext_openUTF8(&s, (char *)aboveBMP, -1, &status); in API_Match_UTF8()
2281 REGEX_ASSERT(m.start(status) == i); in API_Match_UTF8()
2282 REGEX_ASSERT(m.end(status) == i); in API_Match_UTF8()
2293 UErrorCode status=U_ZERO_ERROR; in API_Match_UTF8() local
2294 RegexMatcher m(".?", 0, status); in API_Match_UTF8()
2297 utext_openUTF8(&s, " ", -1, &status); in API_Match_UTF8()
2303 REGEX_ASSERT(m.start(status) == i); in API_Match_UTF8()
2304 REGEX_ASSERT(m.end(status) == (i<4 ? i+1 : i)); in API_Match_UTF8()
2317 UErrorCode status = U_ZERO_ERROR; in API_Match_UTF8() local
2318 RegexMatcher m(".?", 0, status); in API_Match_UTF8()
2321 REGEX_ASSERT(m.start(status) == 0); in API_Match_UTF8()
2325 UErrorCode status = U_ZERO_ERROR; in API_Match_UTF8() local
2326 RegexPattern *p = RegexPattern::compile(".", 0, status); in API_Match_UTF8()
2327 RegexMatcher *m = p->matcher(status); in API_Match_UTF8()
2340 UErrorCode status = U_ZERO_ERROR; in API_Match_UTF8() local
2343 regextst_openUTF8FromInvariant(&testPattern, ".*", -1, &status); in API_Match_UTF8()
2345 regextst_openUTF8FromInvariant(&testText, "This is test data", -1, &status); in API_Match_UTF8()
2348 RegexMatcher m(&testPattern, &testText, 0, status); in API_Match_UTF8()
2355 m.region(2,4, status); in API_Match_UTF8()
2357 REGEX_ASSERT(m.matches(status)); in API_Match_UTF8()
2358 REGEX_ASSERT(m.start(status)==2); in API_Match_UTF8()
2359 REGEX_ASSERT(m.end(status)==4); in API_Match_UTF8()
2366 regextst_openUTF8FromInvariant(&testText, "short", -1, &status); in API_Match_UTF8()
2402 UErrorCode status = U_ZERO_ERROR; in API_Match_UTF8() local
2407 utext_openUTF8(&testPattern, str_, -1, &status); in API_Match_UTF8()
2408 utext_openUTF8(&testText, str_aabb, -1, &status); in API_Match_UTF8()
2410 RegexMatcher m1(&testPattern, &testText, 0, status); in API_Match_UTF8()
2411 REGEX_ASSERT(m1.lookingAt(status) == TRUE); in API_Match_UTF8()
2416 status = U_ZERO_ERROR; in API_Match_UTF8()
2418 utext_openUTF8(&testPattern, str_a, -1, &status); in API_Match_UTF8()
2419 RegexMatcher m2(&testPattern, &testText, 0, status); in API_Match_UTF8()
2420 REGEX_ASSERT(m2.lookingAt(status) == TRUE); in API_Match_UTF8()
2425 status = U_ZERO_ERROR; in API_Match_UTF8()
2427 utext_openUTF8(&testPattern, str_dotstardollar, -1, &status); in API_Match_UTF8()
2428 RegexMatcher m3(&testPattern, &testText, 0, status); in API_Match_UTF8()
2429 REGEX_ASSERT(m3.lookingAt(status) == TRUE); in API_Match_UTF8()
2452 UErrorCode status=U_ZERO_ERROR; in API_Replace_UTF8() local
2455 regextst_openUTF8FromInvariant(&re, "abc", -1, &status); in API_Replace_UTF8()
2457 RegexPattern *pat = RegexPattern::compile(&re, flags, pe, status); in API_Replace_UTF8()
2463 utext_openUTF8(&dataText, data, -1, &status); in API_Replace_UTF8()
2466 RegexMatcher *matcher = &pat->matcher(status)->reset(&dataText); in API_Replace_UTF8()
2473 utext_openUnicodeString(&destText, &dest, &status); in API_Replace_UTF8()
2479 utext_openUTF8(&replText, str_yz, -1, &status); in API_Replace_UTF8()
2481 result = matcher->replaceFirst(&replText, NULL, status); in API_Replace_UTF8()
2486 result = matcher->replaceFirst(&replText, &destText, status); in API_Replace_UTF8()
2491 result = matcher->replaceAll(&replText, NULL, status); in API_Replace_UTF8()
2497 utext_replace(&destText, 0, utext_nativeLength(&destText), NULL, 0, &status); in API_Replace_UTF8()
2498 result = matcher->replaceAll(&replText, &destText, status); in API_Replace_UTF8()
2507 utext_openUTF8(&dataText, str_abxabxabx, -1, &status); in API_Replace_UTF8()
2510 result = matcher->replaceFirst(&replText, NULL, status); in API_Replace_UTF8()
2514 result = matcher->replaceFirst(&replText, &destText, status); in API_Replace_UTF8()
2519 result = matcher->replaceAll(&replText, NULL, status); in API_Replace_UTF8()
2523 utext_replace(&destText, 0, utext_nativeLength(&destText), NULL, 0, &status); in API_Replace_UTF8()
2524 result = matcher->replaceAll(&replText, &destText, status); in API_Replace_UTF8()
2532 utext_openUTF8(&dataText, NULL, 0, &status); in API_Replace_UTF8()
2535 result = matcher->replaceFirst(&replText, NULL, status); in API_Replace_UTF8()
2539 result = matcher->replaceFirst(&replText, &destText, status); in API_Replace_UTF8()
2544 result = matcher->replaceAll(&replText, NULL, status); in API_Replace_UTF8()
2548 result = matcher->replaceAll(&replText, &destText, status); in API_Replace_UTF8()
2556 utext_openUTF8(&dataText, data, -1, &status); // ".abc..abc...abc.." in API_Replace_UTF8()
2559 utext_openUTF8(&replText, NULL, 0, &status); in API_Replace_UTF8()
2560 result = matcher->replaceFirst(&replText, NULL, status); in API_Replace_UTF8()
2565 result = matcher->replaceFirst(&replText, &destText, status); in API_Replace_UTF8()
2570 result = matcher->replaceAll(&replText, NULL, status); in API_Replace_UTF8()
2575 utext_replace(&destText, 0, utext_nativeLength(&destText), NULL, 0, &status); in API_Replace_UTF8()
2576 result = matcher->replaceAll(&replText, &destText, status); in API_Replace_UTF8()
2585 utext_openUTF8(&dataText, str_abc, -1, &status); in API_Replace_UTF8()
2589 utext_openUTF8(&replText, str_xyz, -1, &status); in API_Replace_UTF8()
2590 result = matcher->replaceFirst(&replText, NULL, status); in API_Replace_UTF8()
2594 utext_replace(&destText, 0, utext_nativeLength(&destText), NULL, 0, &status); in API_Replace_UTF8()
2595 result = matcher->replaceFirst(&replText, &destText, status); in API_Replace_UTF8()
2600 result = matcher->replaceAll(&replText, NULL, status); in API_Replace_UTF8()
2604 utext_replace(&destText, 0, utext_nativeLength(&destText), NULL, 0, &status); in API_Replace_UTF8()
2605 result = matcher->replaceAll(&replText, &destText, status); in API_Replace_UTF8()
2614 utext_openUTF8(&re, str_add, -1, &status); in API_Replace_UTF8()
2615 RegexPattern *pat2 = RegexPattern::compile(&re, flags, pe, status); in API_Replace_UTF8()
2619 utext_openUTF8(&dataText, str_abcdefg, -1, &status); in API_Replace_UTF8()
2620 RegexMatcher *matcher2 = &pat2->matcher(status)->reset(&dataText); in API_Replace_UTF8()
2624 utext_openUTF8(&replText, str_11, -1, &status); in API_Replace_UTF8()
2625 result = matcher2->replaceFirst(&replText, NULL, status); in API_Replace_UTF8()
2630 utext_replace(&destText, 0, utext_nativeLength(&destText), NULL, 0, &status); in API_Replace_UTF8()
2631 result = matcher2->replaceFirst(&replText, &destText, status); in API_Replace_UTF8()
2637 utext_openUTF8(&replText, str_v, -1, &status); in API_Replace_UTF8()
2639 result = matcher2->replaceFirst(&replText, NULL, status); in API_Replace_UTF8()
2644 utext_replace(&destText, 0, utext_nativeLength(&destText), NULL, 0, &status); in API_Replace_UTF8()
2645 result = matcher2->replaceFirst(&replText, &destText, status); in API_Replace_UTF8()
2653 utext_openUTF8(&replText, str_byitselfnogroupnumber, -1, &status); in API_Replace_UTF8()
2654 result = matcher2->replaceFirst(&replText, NULL, status); in API_Replace_UTF8()
2659 utext_replace(&destText, 0, utext_nativeLength(&destText), NULL, 0, &status); in API_Replace_UTF8()
2660 result = matcher2->replaceFirst(&replText, &destText, status); in API_Replace_UTF8()
2672 utext_openUTF8(&replText, (char *)supplDigitChars, -1, &status); in API_Replace_UTF8()
2674 result = matcher2->replaceFirst(&replText, NULL, status); in API_Replace_UTF8()
2679 utext_replace(&destText, 0, utext_nativeLength(&destText), NULL, 0, &status); in API_Replace_UTF8()
2680 result = matcher2->replaceFirst(&replText, &destText, status); in API_Replace_UTF8()
2685 utext_openUTF8(&replText, str_badcapturegroupnumber5, -1, &status); in API_Replace_UTF8()
2686 …REGEX_ASSERT_FAIL((result = matcher2->replaceFirst(&replText, NULL, status)), U_INDEX_OUTOFBOUNDS_… in API_Replace_UTF8()
2689 utext_replace(&destText, 0, utext_nativeLength(&destText), NULL, 0, &status); in API_Replace_UTF8()
2690 …REGEX_ASSERT_FAIL((result = matcher2->replaceFirst(&replText, &destText, status)), U_INDEX_OUTOFBO… in API_Replace_UTF8()
2700 utext_openUTF8(&dataText, str_abc1abc2abc3, -1, &status); in API_Replace_UTF8()
2701 utext_openUTF8(&replText, str_u0043, -1, &status); in API_Replace_UTF8()
2704 result = matcher->replaceAll(&replText, NULL, status); in API_Replace_UTF8()
2709 utext_replace(&destText, 0, utext_nativeLength(&destText), NULL, 0, &status); in API_Replace_UTF8()
2710 result = matcher->replaceAll(&replText, &destText, status); in API_Replace_UTF8()
2717 utext_openUTF8(&dataText, str_abc, -1, &status); in API_Replace_UTF8()
2719 utext_openUTF8(&replText, str_U00010000, -1, &status); in API_Replace_UTF8()
2729 result = matcher->replaceAll(&replText, NULL, status); in API_Replace_UTF8()
2733 utext_replace(&destText, 0, utext_nativeLength(&destText), NULL, 0, &status); in API_Replace_UTF8()
2734 result = matcher->replaceAll(&replText, &destText, status); in API_Replace_UTF8()
2744 status = U_ZERO_ERROR; in API_Replace_UTF8()
2748 utext_openUTF8(&re, str_ssee, -1, &status); in API_Replace_UTF8()
2749 utext_openUTF8(&dataText, str_blah, -1, &status); in API_Replace_UTF8()
2750 utext_openUTF8(&replText, str_ooh, -1, &status); in API_Replace_UTF8()
2752 RegexMatcher m(&re, 0, status); in API_Replace_UTF8()
2757 utext_openUnicodeString(&resultText, &result, &status); in API_Replace_UTF8()
2763 m.appendReplacement(&resultText, &replText, status); in API_Replace_UTF8()
2769 status = U_ZERO_ERROR; in API_Replace_UTF8()
2771 utext_openUnicodeString(&resultText, &result, &status); in API_Replace_UTF8()
2772 m.reset(10, status); in API_Replace_UTF8()
2775 m.appendReplacement(&resultText, &replText, status); in API_Replace_UTF8()
2781 status = U_ZERO_ERROR; in API_Replace_UTF8()
2783 utext_openUnicodeString(&resultText, &result, &status); in API_Replace_UTF8()
2785 m.find(10, status); in API_Replace_UTF8()
2787 m.appendReplacement(&resultText, &replText, status); in API_Replace_UTF8()
2792 m.appendTail(&resultText, status); in API_Replace_UTF8()
2826 UErrorCode status = U_ZERO_ERROR; in API_Pattern_UTF8() local
2831 utext_openUTF8(&re1, str_abcalmz, -1, &status); in API_Pattern_UTF8()
2832 utext_openUTF8(&re2, str_def, -1, &status); in API_Pattern_UTF8()
2834 RegexPattern *pat1 = RegexPattern::compile(&re1, 0, pe, status); in API_Pattern_UTF8()
2835 RegexPattern *pat2 = RegexPattern::compile(&re2, 0, pe, status); in API_Pattern_UTF8()
2854 RegexPattern *pat1a = RegexPattern::compile(&re1, pe, status); in API_Pattern_UTF8()
2860 RegexPattern *pat1b = RegexPattern::compile(&re1, UREGEX_CASE_INSENSITIVE, pe, status); in API_Pattern_UTF8()
2887 UErrorCode status = U_ZERO_ERROR; in API_Pattern_UTF8() local
2890 utext_openUTF8(&pattern, str_pL, -1, &status); in API_Pattern_UTF8()
2892 RegexPattern *pSource = RegexPattern::compile(&pattern, 0, status); in API_Pattern_UTF8()
2895 RegexMatcher *mFromClone = pClone->matcher(status); in API_Pattern_UTF8()
2900 utext_openUTF8(&input, str_HelloWorld, -1, &status); in API_Pattern_UTF8()
2903 REGEX_ASSERT(mFromClone->group(status) == "Hello"); in API_Pattern_UTF8()
2905 REGEX_ASSERT(mFromClone->group(status) == "World"); in API_Pattern_UTF8()
2918 UErrorCode status = U_ZERO_ERROR; in API_Pattern_UTF8() local
2923 utext_openUTF8(&input, str_randominput, -1, &status); in API_Pattern_UTF8()
2926 utext_openUTF8(&pattern, str_dotstar, -1, &status); in API_Pattern_UTF8()
2927 REGEX_ASSERT(RegexPattern::matches(&pattern, &input, pe, status) == TRUE); in API_Pattern_UTF8()
2931 utext_openUTF8(&pattern, str_abc, -1, &status); in API_Pattern_UTF8()
2932 REGEX_ASSERT(RegexPattern::matches("abc", "random input", pe, status) == FALSE); in API_Pattern_UTF8()
2936 utext_openUTF8(&pattern, str_nput, -1, &status); in API_Pattern_UTF8()
2937 REGEX_ASSERT(RegexPattern::matches(".*nput", "random input", pe, status) == TRUE); in API_Pattern_UTF8()
2940 utext_openUTF8(&pattern, str_randominput, -1, &status); in API_Pattern_UTF8()
2941 REGEX_ASSERT(RegexPattern::matches("random input", "random input", pe, status) == TRUE); in API_Pattern_UTF8()
2945 utext_openUTF8(&pattern, str_u, -1, &status); in API_Pattern_UTF8()
2946 REGEX_ASSERT(RegexPattern::matches(".*u", "random input", pe, status) == FALSE); in API_Pattern_UTF8()
2949 utext_openUTF8(&input, str_abc, -1, &status); in API_Pattern_UTF8()
2950 utext_openUTF8(&pattern, str_abc, -1, &status); in API_Pattern_UTF8()
2951 status = U_INDEX_OUTOFBOUNDS_ERROR; in API_Pattern_UTF8()
2952 REGEX_ASSERT(RegexPattern::matches("abc", "abc", pe, status) == FALSE); in API_Pattern_UTF8()
2953 REGEX_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in API_Pattern_UTF8()
2963 status = U_ZERO_ERROR; in API_Pattern_UTF8()
2965 utext_openUTF8(&re1, str_spaceplus, -1, &status); in API_Pattern_UTF8()
2966 pat1 = RegexPattern::compile(&re1, pe, status); in API_Pattern_UTF8()
2971 n = pat1->split("Now is the time", fields, 10, status); in API_Pattern_UTF8()
2980 n = pat1->split("Now is the time", fields, 2, status); in API_Pattern_UTF8()
2988 status = U_ZERO_ERROR; in API_Pattern_UTF8()
2989 n = pat1->split("Now is the time", fields, 1, status); in API_Pattern_UTF8()
2994 status = U_ZERO_ERROR; in API_Pattern_UTF8()
2996 n = pat1->split(" Now is the time ", fields, 10, status); in API_Pattern_UTF8()
3008 n = pat1->split(" ", fields, 10, status); in API_Pattern_UTF8()
3016 n = pat1->split("", fields, 10, status); in API_Pattern_UTF8()
3024 regextst_openUTF8FromInvariant(&re1, "<(\\w*)>", -1, &status); in API_Pattern_UTF8()
3025 pat1 = RegexPattern::compile(&re1, pe, status); in API_Pattern_UTF8()
3028 status = U_ZERO_ERROR; in API_Pattern_UTF8()
3030 n = pat1->split("<a>Now is <b>the time<c>", fields, 10, status); in API_Pattern_UTF8()
3041 REGEX_ASSERT(status==U_ZERO_ERROR); in API_Pattern_UTF8()
3044 n = pat1->split(" <a>Now is <b>the time<c>", fields, 10, status); in API_Pattern_UTF8()
3056 status = U_ZERO_ERROR; in API_Pattern_UTF8()
3058 n = pat1->split(" <a>Now is <b>the time<c> ", fields, 6, status); in API_Pattern_UTF8()
3069 status = U_ZERO_ERROR; in API_Pattern_UTF8()
3071 n = pat1->split(" <a>Now is <b>the time<c>", fields, 5, status); in API_Pattern_UTF8()
3081 status = U_ZERO_ERROR; in API_Pattern_UTF8()
3083 n = pat1->split(" <a>Now is <b>the time", fields, 5, status); in API_Pattern_UTF8()
3093 status = U_ZERO_ERROR; in API_Pattern_UTF8()
3094 n = pat1->split(" <a>Now is <b>the time<c>", fields, 4, status); in API_Pattern_UTF8()
3101 status = U_ZERO_ERROR; in API_Pattern_UTF8()
3104 regextst_openUTF8FromInvariant(&re1, "([-,])", -1, &status); in API_Pattern_UTF8()
3105 pat1 = RegexPattern::compile(&re1, pe, status); in API_Pattern_UTF8()
3107 n = pat1->split("1-10,20", fields, 10, status); in API_Pattern_UTF8()
3122 status = U_ZERO_ERROR; in API_Pattern_UTF8()
3123 RegexMatcher matcher(UnicodeString("(:)"), 0, status); in API_Pattern_UTF8()
3125 UText *textToSplit = utext_openUnicodeString(NULL, &stringToSplit, &status); in API_Pattern_UTF8()
3129 int32_t numFields = matcher.split(textToSplit, splits, UPRV_LENGTHOF(splits), status); in API_Pattern_UTF8()
3154 REGEX_ASSERT_UTEXT_UTF8("", pat1->patternText(status)); in API_Pattern_UTF8()
3157 regextst_openUTF8FromInvariant(&re1, helloWorldInvariant, -1, &status); in API_Pattern_UTF8()
3158 pat1 = RegexPattern::compile(&re1, pe, status); in API_Pattern_UTF8()
3161 REGEX_ASSERT_UTEXT_INVARIANT("(Hello, world)*", pat1->patternText(status)); in API_Pattern_UTF8()
3179 UErrorCode status=U_ZERO_ERROR; in getPath() local
3180 const char *testDataDirectory = IntlTest::getSourceTestData(status); in getPath()
3181 if (U_FAILURE(status)) { in getPath()
3182 errln("ERROR: loadTestData() failed - %s", u_errorName(status)); in getPath()
3194 UErrorCode status = U_ZERO_ERROR; in Extended() local
3206 UChar *testData = ReadAndConvertFile(srcPath, len, "utf-8", status); in Extended()
3207 if (U_FAILURE(status)) { in Extended()
3216 RegexMatcher quotedStuffMat(UNICODE_STRING_SIMPLE("\\s*([\\'\\\"/])(.*?)\\1"), 0, status); in Extended()
3217 RegexMatcher commentMat (UNICODE_STRING_SIMPLE("\\s*(#.*)?$"), 0, status); in Extended()
3218 …flagsMat (UNICODE_STRING_SIMPLE("\\s*([ixsmdteDEGLMQvabtyYzZ2-9]*)([:letter:]*)"), 0, status); in Extended()
3220 RegexMatcher lineMat(UNICODE_STRING_SIMPLE("(.*?)\\r?\\n"), testString, 0, status); in Extended()
3225 if (U_FAILURE(status)){ in Extended()
3226 dataerrln("Construct RegexMatcher() error - %s", u_errorName(status)); in Extended()
3236 if (U_FAILURE(status)) { in Extended()
3237 errln("%s:%d: ICU Error \"%s\"", srcPath, lineNum, u_errorName(status)); in Extended()
3240 status = U_ZERO_ERROR; in Extended()
3241 UnicodeString testLine = lineMat.group(1, status); in Extended()
3252 if (commentMat.lookingAt(status)) { in Extended()
3261 if (quotedStuffMat.lookingAt(status)) { in Extended()
3262 testPattern = quotedStuffMat.group(2, status); in Extended()
3263 testLine.remove(0, quotedStuffMat.end(0, status)); in Extended()
3274 flagsMat.lookingAt(status); // Will always match, possibly an empty string. in Extended()
3275 testFlags = flagsMat.group(1, status); in Extended()
3276 if (flagsMat.group(2, status).length() > 0) { in Extended()
3278 lineNum, flagsMat.group(2, status).charAt(0)); in Extended()
3281 testLine.remove(0, flagsMat.end(0, status)); in Extended()
3288 if (quotedStuffMat.lookingAt(status)) { in Extended()
3289 matchString = quotedStuffMat.group(2, status); in Extended()
3290 testLine.remove(0, quotedStuffMat.end(0, status)); in Extended()
3300 if (commentMat.lookingAt(status) == FALSE) { in Extended()
3333 UErrorCode status=U_ZERO_ERROR; in set() local
3340 while (vec.size()<idx+1) {vec.addElement(-1, status);} in set()
3345 UErrorCode status=U_ZERO_ERROR; in setInt() local
3346 while (vec.size()<idx+1) {vec.addElement(-1, status);} in setInt()
3383 UErrorCode status = U_ZERO_ERROR; in regex_find() local
3389 UVector groupStarts(status); in regex_find()
3390 UVector groupEnds(status); in regex_find()
3391 UVector groupStartsUTF8(status); in regex_find()
3392 UVector groupEndsUTF8(status); in regex_find()
3433 callerPattern = RegexPattern::compile(pattern, bflags, pe, status); in regex_find()
3434 if (status != U_ZERO_ERROR) { in regex_find()
3438 if (flags.indexOf((UChar)0x76) >= 0 /*'v'*/ && status == U_UNSUPPORTED_ERROR) { in regex_find()
3445 logln("Pattern Compile returns \"%s\"", u_errorName(status)); in regex_find()
3450 dataerrln("Line %d: error %s compiling pattern.", line, u_errorName(status)); in regex_find()
3455 UTF8Converter = ucnv_open("UTF8", &status); in regex_find()
3456 ucnv_setFromUCallBack(UTF8Converter, UCNV_FROM_U_CALLBACK_STOP, NULL, NULL, NULL, &status); in regex_find()
3458 patternUTF8Length = pattern.extract(NULL, 0, UTF8Converter, status); in regex_find()
3459 status = U_ZERO_ERROR; // buffer overflow in regex_find()
3461 pattern.extract(patternChars, patternUTF8Length+1, UTF8Converter, status); in regex_find()
3462 utext_openUTF8(&patternText, patternChars, patternUTF8Length, &status); in regex_find()
3464 if (status == U_ZERO_ERROR) { in regex_find()
3465 UTF8Pattern = RegexPattern::compile(&patternText, bflags, pe, status); in regex_find()
3467 if (status != U_ZERO_ERROR) { in regex_find()
3471 if (flags.indexOf((UChar)0x76) >= 0 /*'v'*/ && status == U_UNSUPPORTED_ERROR) { in regex_find()
3478 logln("Pattern Compile returns \"%s\" (UTF8)", u_errorName(status)); in regex_find()
3483 errln("Line %d: error %s compiling pattern. (UTF8)", line, u_errorName(status)); in regex_find()
3492 status = U_ZERO_ERROR; in regex_find()
3531 parsePat = RegexPattern::compile("<(/?)(r|[0-9]+)>", 0, pe, status); in regex_find()
3535 parseMatcher = parsePat->matcher(unEscapedInput, status); in regex_find()
3538 parseMatcher->appendReplacement(deTaggedInput, "", status); in regex_find()
3540 UnicodeString groupNum = parseMatcher->group(2, status); in regex_find()
3543 if (parseMatcher->group(1, status) == "/") { in regex_find()
3550 if (parseMatcher->group(1, status) == "/") { in regex_find()
3568 matcher = callerPattern->matcher(deTaggedInput, status); in regex_find()
3575 inputUTF8Length = deTaggedInput.extract(NULL, 0, UTF8Converter, status); in regex_find()
3576 status = U_ZERO_ERROR; // buffer overflow in regex_find()
3578 deTaggedInput.extract(inputChars, inputUTF8Length+1, UTF8Converter, status); in regex_find()
3579 utext_openUTF8(&inputText, inputChars, inputUTF8Length, &status); in regex_find()
3581 if (status == U_ZERO_ERROR) { in regex_find()
3582 UTF8Matcher = &UTF8Pattern->matcher(status)->reset(&inputText); in regex_find()
3589 status = U_ZERO_ERROR; in regex_find()
3633 matcher->region(regionStart, regionEnd, status); in regex_find()
3636 UTF8Matcher->region(regionStartUTF8, regionEndUTF8, status); in regex_find()
3662 isMatch = matcher->matches(status); in regex_find()
3664 isUTF8Match = UTF8Matcher->matches(status); in regex_find()
3667 isMatch = matcher->lookingAt(status); in regex_find()
3669 isUTF8Match = UTF8Matcher->lookingAt(status); in regex_find()
3682 if (U_FAILURE(status)) { in regex_find()
3683 errln("Error at line %d. ICU ErrorCode is %s", u_errorName(status)); in regex_find()
3704 …Error at line %d: No match expected, but one found at position %d.", line, matcher->start(status)); in regex_find()
3708 …e %d: No match expected, but one found at position %d (UTF-8).", line, UTF8Matcher->start(status)); in regex_find()
3721 if (matcher->start(i, status) != expectedStart) { in regex_find()
3723 line, i, expectedStart, matcher->start(i, status)); in regex_find()
3726 } else if (UTF8Matcher != NULL && UTF8Matcher->start(i, status) != expectedStartUTF8) { in regex_find()
3728 line, i, expectedStartUTF8, UTF8Matcher->start(i, status)); in regex_find()
3735 if (matcher->end(i, status) != expectedEnd) { in regex_find()
3737 line, i, expectedEnd, matcher->end(i, status)); in regex_find()
3741 } else if (UTF8Matcher != NULL && UTF8Matcher->end(i, status) != expectedEndUTF8) { in regex_find()
3743 line, i, expectedEndUTF8, UTF8Matcher->end(i, status)); in regex_find()
3850 UErrorCode status = U_ZERO_ERROR; in Errors() local
3854 RegexPattern *pat1= RegexPattern::compile(".*", flags, pe, status); in Errors()
3855 REGEX_ASSERT(status == U_REGEX_UNIMPLEMENTED); in Errors()
3895 const char *defEncoding, UErrorCode &status) { in ReadAndConvertFile() argument
3902 if (U_FAILURE(status)) { in ReadAndConvertFile()
3912 status = U_FILE_ACCESS_ERROR; in ReadAndConvertFile()
3940 fileBuf, fileSize, &signatureLength, &status); in ReadAndConvertFile()
3954 conv = ucnv_open(encoding, &status); in ReadAndConvertFile()
3955 if (U_FAILURE(status)) { in ReadAndConvertFile()
3968 &status); in ReadAndConvertFile()
3969 if (status == U_BUFFER_OVERFLOW_ERROR) { in ReadAndConvertFile()
3971 status = U_ZERO_ERROR; in ReadAndConvertFile()
3979 &status); in ReadAndConvertFile()
3986 if (U_FAILURE(status)) { in ReadAndConvertFile()
3987 errln("ucnv_toUChars: ICU Error \"%s\"\n", u_errorName(status)); in ReadAndConvertFile()
4043 UErrorCode status = U_ZERO_ERROR; in PerlTests() local
4055 UChar *testData = ReadAndConvertFile(srcPath, len, "iso-8859-1", status); in PerlTests()
4056 if (U_FAILURE(status)) { in PerlTests()
4069 …exPattern* linePat = RegexPattern::compile(UNICODE_STRING_SIMPLE("(.+?)[\\r\\n]+"), 0, pe, status); in PerlTests()
4070 if (U_FAILURE(status)) { in PerlTests()
4074 RegexMatcher* lineMat = linePat->matcher(testDataString, status); in PerlTests()
4080 RegexPattern* fieldPat = RegexPattern::compile(UNICODE_STRING_SIMPLE("\\t"), 0, pe, status); in PerlTests()
4088 …xPattern *flagPat = RegexPattern::compile(UNICODE_STRING_SIMPLE("('?)(.*)\\1(.*)"), 0, pe, status); in PerlTests()
4089 RegexMatcher* flagMat = flagPat->matcher(status); in PerlTests()
4105 …groupsPat = RegexPattern::compile(UNICODE_STRING_SIMPLE("\\$([+\\-])\\[(\\d+)\\]"), 0, pe, status); in PerlTests()
4106 RegexMatcher *groupsMat = groupsPat->matcher(status); in PerlTests()
4109 RegexPattern *cgPat = RegexPattern::compile(UNICODE_STRING_SIMPLE("\\$(\\d+)"), 0, pe, status); in PerlTests()
4110 RegexMatcher *cgMat = cgPat->matcher(status); in PerlTests()
4126 UnicodeString line = lineMat->group(1, status); in PerlTests()
4128 fieldPat->split(line, fields, 7, status); in PerlTests()
4131 flagMat->matches(status); in PerlTests()
4132 UnicodeString pattern = flagMat->group(2, status); in PerlTests()
4141 UnicodeString flagStr = flagMat->group(3, status); in PerlTests()
4142 if (U_FAILURE(status)) { in PerlTests()
4143 errln("ucnv_toUChars: ICU Error \"%s\"\n", u_errorName(status)); in PerlTests()
4165 status = U_ZERO_ERROR; in PerlTests()
4166 RegexPattern *testPat = RegexPattern::compile(pattern, flags, pe, status); in PerlTests()
4167 if (status == U_REGEX_UNIMPLEMENTED) { in PerlTests()
4173 status = U_ZERO_ERROR; in PerlTests()
4177 if (U_FAILURE(status)) { in PerlTests()
4183 errln("line %d: ICU Error \"%s\"\n", lineNum, u_errorName(status)); in PerlTests()
4185 status = U_ZERO_ERROR; in PerlTests()
4221 RegexMatcher *testMat = testPat->matcher(matchString, status); in PerlTests()
4263 resultString.append(testMat->group(status)); in PerlTests()
4267 else if (groupsMat->lookingAt(status)) { in PerlTests()
4269 UnicodeString digitString = groupsMat->group(2, status); in PerlTests()
4272 UnicodeString plusOrMinus = groupsMat->group(1, status); in PerlTests()
4275 matchPosition = testMat->end(groupNum, status); in PerlTests()
4277 matchPosition = testMat->start(groupNum, status); in PerlTests()
4282 perlExpr.remove(0, groupsMat->end(status)); in PerlTests()
4285 else if (cgMat->lookingAt(status)) { in PerlTests()
4287 UnicodeString digitString = cgMat->group(1, status); in PerlTests()
4290 if (U_SUCCESS(status)) { in PerlTests()
4291 resultString.append(testMat->group(groupNum, status)); in PerlTests()
4292 status = U_ZERO_ERROR; in PerlTests()
4294 perlExpr.remove(0, cgMat->end(status)); in PerlTests()
4303 ICU_Utility::appendNumber(resultString, testMat->start(i, status)); in PerlTests()
4314 ICU_Utility::appendNumber(resultString, testMat->end(i, status)); in PerlTests()
4341 if (U_FAILURE(status)) { in PerlTests()
4342 errln("Line %d: ICU Error \"%s\"", lineNum, u_errorName(status)); in PerlTests()
4401 UErrorCode status = U_ZERO_ERROR; in PerlTestsUTF8() local
4403 LocalUConverterPointer UTF8Converter(ucnv_open("UTF-8", &status)); in PerlTestsUTF8()
4413 …v_setFromUCallBack(UTF8Converter.getAlias(), UCNV_FROM_U_CALLBACK_STOP, NULL, NULL, NULL, &status); in PerlTestsUTF8()
4424 UChar *testData = ReadAndConvertFile(srcPath, len, "iso-8859-1", status); in PerlTestsUTF8()
4425 if (U_FAILURE(status)) { in PerlTestsUTF8()
4438 …exPattern* linePat = RegexPattern::compile(UNICODE_STRING_SIMPLE("(.+?)[\\r\\n]+"), 0, pe, status); in PerlTestsUTF8()
4439 if (U_FAILURE(status)) { in PerlTestsUTF8()
4443 RegexMatcher* lineMat = linePat->matcher(testDataString, status); in PerlTestsUTF8()
4449 RegexPattern* fieldPat = RegexPattern::compile(UNICODE_STRING_SIMPLE("\\t"), 0, pe, status); in PerlTestsUTF8()
4457 …xPattern *flagPat = RegexPattern::compile(UNICODE_STRING_SIMPLE("('?)(.*)\\1(.*)"), 0, pe, status); in PerlTestsUTF8()
4458 RegexMatcher* flagMat = flagPat->matcher(status); in PerlTestsUTF8()
4474 …groupsPat = RegexPattern::compile(UNICODE_STRING_SIMPLE("\\$([+\\-])\\[(\\d+)\\]"), 0, pe, status); in PerlTestsUTF8()
4475 RegexMatcher *groupsMat = groupsPat->matcher(status); in PerlTestsUTF8()
4478 RegexPattern *cgPat = RegexPattern::compile(UNICODE_STRING_SIMPLE("\\$(\\d+)"), 0, pe, status); in PerlTestsUTF8()
4479 RegexMatcher *cgMat = cgPat->matcher(status); in PerlTestsUTF8()
4495 UnicodeString line = lineMat->group(1, status); in PerlTestsUTF8()
4497 fieldPat->split(line, fields, 7, status); in PerlTestsUTF8()
4500 flagMat->matches(status); in PerlTestsUTF8()
4501 UnicodeString pattern = flagMat->group(2, status); in PerlTestsUTF8()
4510 UnicodeString flagStr = flagMat->group(3, status); in PerlTestsUTF8()
4511 if (U_FAILURE(status)) { in PerlTestsUTF8()
4512 errln("ucnv_toUChars: ICU Error \"%s\"\n", u_errorName(status)); in PerlTestsUTF8()
4534 status = U_ZERO_ERROR; in PerlTestsUTF8()
4535 … patternLength = pattern.extract(patternChars, patternCapacity, UTF8Converter.getAlias(), status); in PerlTestsUTF8()
4536 if (status == U_BUFFER_OVERFLOW_ERROR) { in PerlTestsUTF8()
4537 status = U_ZERO_ERROR; in PerlTestsUTF8()
4541 pattern.extract(patternChars, patternCapacity, UTF8Converter.getAlias(), status); in PerlTestsUTF8()
4543 utext_openUTF8(&patternText, patternChars, patternLength, &status); in PerlTestsUTF8()
4548 RegexPattern *testPat = RegexPattern::compile(&patternText, flags, pe, status); in PerlTestsUTF8()
4549 if (status == U_REGEX_UNIMPLEMENTED) { in PerlTestsUTF8()
4555 status = U_ZERO_ERROR; in PerlTestsUTF8()
4559 if (U_FAILURE(status)) { in PerlTestsUTF8()
4565 errln("line %d: ICU Error \"%s\"\n", lineNum, u_errorName(status)); in PerlTestsUTF8()
4567 status = U_ZERO_ERROR; in PerlTestsUTF8()
4602 status = U_ZERO_ERROR; in PerlTestsUTF8()
4603 … inputLength = matchString.extract(inputChars, inputCapacity, UTF8Converter.getAlias(), status); in PerlTestsUTF8()
4604 if (status == U_BUFFER_OVERFLOW_ERROR) { in PerlTestsUTF8()
4605 status = U_ZERO_ERROR; in PerlTestsUTF8()
4609 matchString.extract(inputChars, inputCapacity, UTF8Converter.getAlias(), status); in PerlTestsUTF8()
4611 utext_openUTF8(&inputText, inputChars, inputLength, &status); in PerlTestsUTF8()
4616 RegexMatcher *testMat = &testPat->matcher(status)->reset(&inputText); in PerlTestsUTF8()
4651 resultString.append(testMat->group(status)); in PerlTestsUTF8()
4655 else if (groupsMat->lookingAt(status)) { in PerlTestsUTF8()
4657 UnicodeString digitString = groupsMat->group(2, status); in PerlTestsUTF8()
4660 UnicodeString plusOrMinus = groupsMat->group(1, status); in PerlTestsUTF8()
4663 matchPosition = testMat->end(groupNum, status); in PerlTestsUTF8()
4665 matchPosition = testMat->start(groupNum, status); in PerlTestsUTF8()
4670 perlExpr.remove(0, groupsMat->end(status)); in PerlTestsUTF8()
4673 else if (cgMat->lookingAt(status)) { in PerlTestsUTF8()
4675 UnicodeString digitString = cgMat->group(1, status); in PerlTestsUTF8()
4678 if (U_SUCCESS(status)) { in PerlTestsUTF8()
4679 resultString.append(testMat->group(groupNum, status)); in PerlTestsUTF8()
4680 status = U_ZERO_ERROR; in PerlTestsUTF8()
4682 perlExpr.remove(0, cgMat->end(status)); in PerlTestsUTF8()
4691 ICU_Utility::appendNumber(resultString, testMat->start(i, status)); in PerlTestsUTF8()
4702 ICU_Utility::appendNumber(resultString, testMat->end(i, status)); in PerlTestsUTF8()
4729 if (U_FAILURE(status)) { in PerlTestsUTF8()
4730 errln("Line %d: ICU Error \"%s\"", lineNum, u_errorName(status)); in PerlTestsUTF8()
4797 UErrorCode status = U_ZERO_ERROR; in Bug6149() local
4799 RegexMatcher matcher(pattern, s, flags, status); in Bug6149()
4801 REGEX_ASSERT_FAIL(result=matcher.matches(status), U_REGEX_STACK_OVERFLOW); in Bug6149()
4843 UErrorCode status = U_ZERO_ERROR; in Callbacks() local
4844 RegexMatcher matcher("x", 0, status); in Callbacks()
4846 matcher.getMatchCallback(returnedFn, returnedContext, status); in Callbacks()
4857 UErrorCode status = U_ZERO_ERROR; in Callbacks() local
4858 …RegexMatcher matcher(UNICODE_STRING_SIMPLE("((.)+\\2)+x"), 0, status); // A pattern that can run … in Callbacks()
4860 matcher.setMatchCallback(testCallBackFn, &cbInfo, status); in Callbacks()
4862 matcher.getMatchCallback(returnedFn, returnedContext, status); in Callbacks()
4868 status = U_ZERO_ERROR; in Callbacks()
4872 REGEX_ASSERT(matcher.matches(status)); in Callbacks()
4878 status = U_ZERO_ERROR; in Callbacks()
4882 REGEX_ASSERT(matcher.matches(status)==FALSE); in Callbacks()
4887 status = U_ZERO_ERROR; in Callbacks()
4891 REGEX_ASSERT(matcher.matches(status)==FALSE); in Callbacks()
4892 REGEX_ASSERT(status == U_REGEX_STOPPED_BY_CALLER); in Callbacks()
4896 status = U_ZERO_ERROR; in Callbacks()
4900 REGEX_ASSERT(matcher.find(status)==FALSE); in Callbacks()
4901 REGEX_ASSERT(status == U_REGEX_STOPPED_BY_CALLER); in Callbacks()
4947 UErrorCode status = U_ZERO_ERROR; in FindProgressCallbacks() local
4948 RegexMatcher matcher("x", 0, status); in FindProgressCallbacks()
4950 matcher.getFindProgressCallback(returnedFn, returnedContext, status); in FindProgressCallbacks()
4961 UErrorCode status = U_ZERO_ERROR; in FindProgressCallbacks() local
4962 RegexMatcher matcher(UNICODE_STRING_SIMPLE("((.)\\2)x"), 0, status); in FindProgressCallbacks()
4964 matcher.setFindProgressCallback(testProgressCallBackFn, &cbInfo, status); in FindProgressCallbacks()
4966 matcher.getFindProgressCallback(returnedFn, returnedContext, status); in FindProgressCallbacks()
4972 status = U_ZERO_ERROR; in FindProgressCallbacks()
4979 REGEX_ASSERT(matcher.find(0, status)); in FindProgressCallbacks()
4985 status = U_ZERO_ERROR; in FindProgressCallbacks()
4989 REGEX_ASSERT(matcher.find(0, status)==FALSE); in FindProgressCallbacks()
4994 status = U_ZERO_ERROR; in FindProgressCallbacks()
4998 REGEX_ASSERT(matcher.find(0, status)==FALSE); in FindProgressCallbacks()
4999 REGEX_ASSERT(status == U_REGEX_STOPPED_BY_CALLER); in FindProgressCallbacks()
5003 status = U_ZERO_ERROR; in FindProgressCallbacks()
5007 REGEX_ASSERT(matcher.find(0, status)==FALSE); in FindProgressCallbacks()
5008 REGEX_ASSERT(status == U_REGEX_STOPPED_BY_CALLER); in FindProgressCallbacks()
5011 status = U_ZERO_ERROR; in FindProgressCallbacks()
5012 REGEX_ASSERT(matcher.find(cbInfo.lastIndex, status)); in FindProgressCallbacks()
5029 UErrorCode status = U_ZERO_ERROR; in PreAllocatedUTextCAPI() local
5035 utext_openUnicodeString(&bufferText, &buffer, &status); in PreAllocatedUTextCAPI()
5046 status = U_ZERO_ERROR; in PreAllocatedUTextCAPI()
5047 regextst_openUTF8FromInvariant(&text1, "abcccd", -1, &status); in PreAllocatedUTextCAPI()
5048 regextst_openUTF8FromInvariant(&text2, "abcccxd", -1, &status); in PreAllocatedUTextCAPI()
5050 utext_openUChars(&text2, text2Chars, -1, &status); in PreAllocatedUTextCAPI()
5052 regextst_openUTF8FromInvariant(&patternText, "abc*d", -1, &status); in PreAllocatedUTextCAPI()
5053 re = uregex_openUText(&patternText, 0, NULL, &status); in PreAllocatedUTextCAPI()
5056 uregex_setUText(re, &text1, &status); in PreAllocatedUTextCAPI()
5057 resultText = uregex_getUText(re, &bufferText, &status); in PreAllocatedUTextCAPI()
5064 resultText = uregex_getUText(re, &bufferText, &status); in PreAllocatedUTextCAPI()
5072 uregex_setText(re, text2Chars, 7, &status); in PreAllocatedUTextCAPI()
5073 resultText = uregex_getUText(re, &bufferText, &status); in PreAllocatedUTextCAPI()
5098 status = U_ZERO_ERROR; in PreAllocatedUTextCAPI()
5099 re = uregex_openC("abc(.*?)def", 0, NULL, &status); in PreAllocatedUTextCAPI()
5102 uregex_setText(re, text1, -1, &status); in PreAllocatedUTextCAPI()
5103 result = uregex_find(re, 0, &status); in PreAllocatedUTextCAPI()
5107 status = U_ZERO_ERROR; in PreAllocatedUTextCAPI()
5108 actual = uregex_groupUText(re, 0, &bufferText, &length, &status); in PreAllocatedUTextCAPI()
5116 status = U_ZERO_ERROR; in PreAllocatedUTextCAPI()
5117 actual = uregex_groupUText(re, 1, &bufferText, &length, &status); in PreAllocatedUTextCAPI()
5125 status = U_ZERO_ERROR; in PreAllocatedUTextCAPI()
5126 actual = uregex_groupUText(re, 2, &bufferText, &length, &status); in PreAllocatedUTextCAPI()
5127 REGEX_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in PreAllocatedUTextCAPI()
5141 status = U_ZERO_ERROR; in PreAllocatedUTextCAPI()
5142 utext_openUnicodeString(&bufferText, &buffer, &status); in PreAllocatedUTextCAPI()
5144 status = U_ZERO_ERROR; in PreAllocatedUTextCAPI()
5147 regextst_openUTF8FromInvariant(&replText, "<$1>", -1, &status); in PreAllocatedUTextCAPI()
5149 re = uregex_openC("x(.*?)x", 0, NULL, &status); in PreAllocatedUTextCAPI()
5153 uregex_setText(re, text1, -1, &status); in PreAllocatedUTextCAPI()
5155 utext_replace(&bufferText, 0, utext_nativeLength(&bufferText), NULL, 0, &status); in PreAllocatedUTextCAPI()
5157 result = uregex_replaceFirstUText(re, &replText, &bufferText, &status); in PreAllocatedUTextCAPI()
5163 uregex_setText(re, text2, -1, &status); in PreAllocatedUTextCAPI()
5164 utext_replace(&bufferText, 0, utext_nativeLength(&bufferText), NULL, 0, &status); in PreAllocatedUTextCAPI()
5165 result = uregex_replaceFirstUText(re, &replText, &bufferText, &status); in PreAllocatedUTextCAPI()
5171 uregex_setText(re, text1, -1, &status); in PreAllocatedUTextCAPI()
5172 regextst_openUTF8FromInvariant(&replText, "\\\\\\u0041$1\\U00000042\\$\\a", -1, &status); in PreAllocatedUTextCAPI()
5173 utext_replace(&bufferText, 0, utext_nativeLength(&bufferText), NULL, 0, &status); in PreAllocatedUTextCAPI()
5174 result = uregex_replaceFirstUText(re, &replText, &bufferText, &status); in PreAllocatedUTextCAPI()
5193 status = U_ZERO_ERROR; in PreAllocatedUTextCAPI()
5196 regextst_openUTF8FromInvariant(&replText, "<$1>", -1, &status); in PreAllocatedUTextCAPI()
5198 re = uregex_openC("x(.*?)x", 0, NULL, &status); in PreAllocatedUTextCAPI()
5202 uregex_setText(re, text1, -1, &status); in PreAllocatedUTextCAPI()
5203 utext_replace(&bufferText, 0, utext_nativeLength(&bufferText), NULL, 0, &status); in PreAllocatedUTextCAPI()
5204 result = uregex_replaceAllUText(re, &replText, &bufferText, &status); in PreAllocatedUTextCAPI()
5210 uregex_setText(re, text2, -1, &status); in PreAllocatedUTextCAPI()
5211 utext_replace(&bufferText, 0, utext_nativeLength(&bufferText), NULL, 0, &status); in PreAllocatedUTextCAPI()
5212 result = uregex_replaceAllUText(re, &replText, &bufferText, &status); in PreAllocatedUTextCAPI()
5238 UErrorCode status = U_ZERO_ERROR; in NamedCapture() local
5240 "abc()()(?<three>xyz)(de)(?<five>hmm)(?<six>oh)f\\k<five>"), 0, status); in NamedCapture()
5242 int32_t group = pat->groupNumberFromName("five", -1, status); in NamedCapture()
5245 group = pat->groupNumberFromName("three", -1, status); in NamedCapture()
5249 status = U_ZERO_ERROR; in NamedCapture()
5250 group = pat->groupNumberFromName(UnicodeString("six"), status); in NamedCapture()
5254 status = U_ZERO_ERROR; in NamedCapture()
5255 group = pat->groupNumberFromName(UnicodeString("nosuch"), status); in NamedCapture()
5256 U_ASSERT(status == U_REGEX_INVALID_CAPTURE_GROUP_NAME); in NamedCapture()
5258 status = U_ZERO_ERROR; in NamedCapture()
5265 group = copiedPat->groupNumberFromName("five", -1, status); in NamedCapture()
5268 group = copiedPat->groupNumberFromName("three", -1, status); in NamedCapture()
5274 status = U_ZERO_ERROR; in NamedCapture()
5276 RegexMatcher *m = new RegexMatcher(UnicodeString("<<(?<mid>.+?)>>"), text, 0, status); in NamedCapture()
5279 UnicodeString replacedText = m->replaceAll("'${mid}'", status); in NamedCapture()
5286 m = new RegexMatcher(UnicodeString("..(?<one>m)(.)(.)"), text, 0, status); in NamedCapture()
5289 status = U_ZERO_ERROR; in NamedCapture()
5290 …replacedText = m->replaceAll(UnicodeString("<$0>"), status); // group 0, full match, is allowed. in NamedCapture()
5294 status = U_ZERO_ERROR; in NamedCapture()
5295 replacedText = m->replaceAll(UnicodeString("<$1>"), status); // group 1 by number. in NamedCapture()
5299 status = U_ZERO_ERROR; in NamedCapture()
5300 replacedText = m->replaceAll(UnicodeString("<${one}>"), status); // group 1 by name. in NamedCapture()
5304 status = U_ZERO_ERROR; in NamedCapture()
5305 replacedText = m->replaceAll(UnicodeString("<$2>"), status); // group 2. in NamedCapture()
5309 status = U_ZERO_ERROR; in NamedCapture()
5310 replacedText = m->replaceAll(UnicodeString("<$3>"), status); in NamedCapture()
5314 status = U_ZERO_ERROR; in NamedCapture()
5315 replacedText = m->replaceAll(UnicodeString("<$4>"), status); in NamedCapture()
5316 REGEX_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in NamedCapture()
5318 status = U_ZERO_ERROR; in NamedCapture()
5319 replacedText = m->replaceAll(UnicodeString("<$04>"), status); // group 0, leading 0, in NamedCapture()
5323 status = U_ZERO_ERROR; in NamedCapture()
5324 …replacedText = m->replaceAll(UnicodeString("<$000016>"), status); // Consume leading zeroes. Don… in NamedCapture()
5328 status = U_ZERO_ERROR; in NamedCapture()
5329 replacedText = m->replaceAll(UnicodeString("<$3$2$1${one}>"), status); in NamedCapture()
5333 status = U_ZERO_ERROR; in NamedCapture()
5334 replacedText = m->replaceAll(UnicodeString("$3$2$1${one}"), status); in NamedCapture()
5338 status = U_ZERO_ERROR; in NamedCapture()
5339 replacedText = m->replaceAll(UnicodeString("<${noSuchName}>"), status); in NamedCapture()
5340 REGEX_ASSERT(status == U_REGEX_INVALID_CAPTURE_GROUP_NAME); in NamedCapture()
5342 status = U_ZERO_ERROR; in NamedCapture()
5343 replacedText = m->replaceAll(UnicodeString("<${invalid-name}>"), status); in NamedCapture()
5344 REGEX_ASSERT(status == U_REGEX_INVALID_CAPTURE_GROUP_NAME); in NamedCapture()
5346 status = U_ZERO_ERROR; in NamedCapture()
5347 replacedText = m->replaceAll(UnicodeString("<${one"), status); in NamedCapture()
5348 REGEX_ASSERT(status == U_REGEX_INVALID_CAPTURE_GROUP_NAME); in NamedCapture()
5350 status = U_ZERO_ERROR; in NamedCapture()
5351 replacedText = m->replaceAll(UnicodeString("$not a capture group"), status); in NamedCapture()
5352 REGEX_ASSERT(status == U_REGEX_INVALID_CAPTURE_GROUP_NAME); in NamedCapture()
5360 status = U_ZERO_ERROR; in NamedCapture()
5361 URegularExpression *re = uregex_openC("..(?<one>m)(.)(.)", 0, NULL, &status); in NamedCapture()
5364 uregex_setText(re, text.getBuffer(), text.length(), &status); in NamedCapture()
5371 status = U_ZERO_ERROR; in NamedCapture()
5373 …egex_replaceAll(re, repl.getBuffer(), repl.length(), resultBuf, UPRV_LENGTHOF(resultBuf), &status); in NamedCapture()
5377 status = U_ZERO_ERROR; in NamedCapture()
5379 …egex_replaceAll(re, repl.getBuffer(), repl.length(), resultBuf, UPRV_LENGTHOF(resultBuf), &status); in NamedCapture()
5383 status = U_ZERO_ERROR; in NamedCapture()
5385 …egex_replaceAll(re, repl.getBuffer(), repl.length(), resultBuf, UPRV_LENGTHOF(resultBuf), &status); in NamedCapture()
5389 status = U_ZERO_ERROR; in NamedCapture()
5391 …egex_replaceAll(re, repl.getBuffer(), repl.length(), resultBuf, UPRV_LENGTHOF(resultBuf), &status); in NamedCapture()
5395 status = U_ZERO_ERROR; in NamedCapture()
5397 …egex_replaceAll(re, repl.getBuffer(), repl.length(), resultBuf, UPRV_LENGTHOF(resultBuf), &status); in NamedCapture()
5401 status = U_ZERO_ERROR; in NamedCapture()
5403 …egex_replaceAll(re, repl.getBuffer(), repl.length(), resultBuf, UPRV_LENGTHOF(resultBuf), &status); in NamedCapture()
5404 REGEX_ASSERT(status == U_INDEX_OUTOFBOUNDS_ERROR); in NamedCapture()
5406 status = U_ZERO_ERROR; in NamedCapture()
5408 …egex_replaceAll(re, repl.getBuffer(), repl.length(), resultBuf, UPRV_LENGTHOF(resultBuf), &status); in NamedCapture()
5412 status = U_ZERO_ERROR; in NamedCapture()
5414 …egex_replaceAll(re, repl.getBuffer(), repl.length(), resultBuf, UPRV_LENGTHOF(resultBuf), &status); in NamedCapture()
5418 status = U_ZERO_ERROR; in NamedCapture()
5420 …egex_replaceAll(re, repl.getBuffer(), repl.length(), resultBuf, UPRV_LENGTHOF(resultBuf), &status); in NamedCapture()
5424 status = U_ZERO_ERROR; in NamedCapture()
5426 …egex_replaceAll(re, repl.getBuffer(), repl.length(), resultBuf, UPRV_LENGTHOF(resultBuf), &status); in NamedCapture()
5430 status = U_ZERO_ERROR; in NamedCapture()
5432 …egex_replaceAll(re, repl.getBuffer(), repl.length(), resultBuf, UPRV_LENGTHOF(resultBuf), &status); in NamedCapture()
5433 REGEX_ASSERT(status == U_REGEX_INVALID_CAPTURE_GROUP_NAME); in NamedCapture()
5435 status = U_ZERO_ERROR; in NamedCapture()
5437 …egex_replaceAll(re, repl.getBuffer(), repl.length(), resultBuf, UPRV_LENGTHOF(resultBuf), &status); in NamedCapture()
5438 REGEX_ASSERT(status == U_REGEX_INVALID_CAPTURE_GROUP_NAME); in NamedCapture()
5440 status = U_ZERO_ERROR; in NamedCapture()
5442 …egex_replaceAll(re, repl.getBuffer(), repl.length(), resultBuf, UPRV_LENGTHOF(resultBuf), &status); in NamedCapture()
5443 REGEX_ASSERT(status == U_REGEX_INVALID_CAPTURE_GROUP_NAME); in NamedCapture()
5445 status = U_ZERO_ERROR; in NamedCapture()
5447 …egex_replaceAll(re, repl.getBuffer(), repl.length(), resultBuf, UPRV_LENGTHOF(resultBuf), &status); in NamedCapture()
5448 REGEX_ASSERT(status == U_REGEX_INVALID_CAPTURE_GROUP_NAME); in NamedCapture()
5476 UErrorCode status = U_ZERO_ERROR; in NamedCaptureLimits() local
5477 RegexPattern *pat = RegexPattern::compile(pattern, 0, status); in NamedCaptureLimits()
5481 int32_t groupNum = pat->groupNumberFromName(nnbuf, -1, status); in NamedCaptureLimits()
5494 status = U_ZERO_ERROR; in NamedCaptureLimits()
5495 pat = RegexPattern::compile(pattern, 0, status); in NamedCaptureLimits()
5496 REGEX_ASSERT(status == U_REGEX_PATTERN_TOO_BIG); in NamedCaptureLimits()
5514 UErrorCode status = U_ZERO_ERROR; in Bug7651() local
5517 REPattern = RegexPattern::compile(pattern1, 0, pe, status); in Bug7651()
5519 REMatcher = REPattern->matcher(s, status); in Bug7651()
5522 REGEX_ASSERT(REMatcher->start(status) == 0); in Bug7651()
5525 status = U_ZERO_ERROR; in Bug7651()
5527 REPattern = RegexPattern::compile(pattern2, 0, pe, status); in Bug7651()
5529 REMatcher = REPattern->matcher(s, status); in Bug7651()
5532 REGEX_ASSERT(REMatcher->start(status) == 0); in Bug7651()
5535 status = U_ZERO_ERROR; in Bug7651()
5539 UErrorCode status = U_ZERO_ERROR; in Bug7740() local
5542 RegexMatcher *m = new RegexMatcher(pattern, text, 0, status); in Bug7740()
5544 REGEX_ASSERT(m->lookingAt(status)); in Bug7740()
5546 status = U_ILLEGAL_ARGUMENT_ERROR; in Bug7740()
5547 UnicodeString s = m->group(1, status); // Bug 7740: segfault here. in Bug7740()
5548 REGEX_ASSERT(status == U_ILLEGAL_ARGUMENT_ERROR); in Bug7740()
5556 UErrorCode status = U_ZERO_ERROR; in Bug8479() local
5558 …her* const pMatcher = new RegexMatcher("\\Aboo\\z", UREGEX_DOTALL|UREGEX_CASE_INSENSITIVE, status); in Bug8479()
5560 if (U_SUCCESS(status)) in Bug8479()
5565 status = U_ZERO_ERROR; in Bug8479()
5566 pMatcher->matches(status); in Bug8479()
5567 REGEX_ASSERT(status == U_ILLEGAL_ARGUMENT_ERROR); in Bug8479()
5575 UErrorCode status = U_ZERO_ERROR; in Bug7029() local
5577 RegexMatcher* const pMatcher = new RegexMatcher(".", 0, status); in Bug7029()
5581 int32_t numFields = pMatcher->split(text, splits, 10, status); in Bug7029()
5600 UErrorCode status = U_ZERO_ERROR; in Bug9283() local
5601 UnicodeSet supplementalsWithCaseFolding("[[:CWCF:]&[\\U00010000-\\U0010FFFF]]", status); in Bug9283()
5628 UErrorCode status = U_ZERO_ERROR; in Bug10459() local
5632 UText *utext_pat = utext_openUnicodeString(NULL, &patternString, &status); in Bug10459()
5634 UText *utext_txt = utext_openUnicodeString(NULL, &txtString, &status); in Bug10459()
5637 URegularExpression *icu_re = uregex_openUText(utext_pat, 0, NULL, &status); in Bug10459()
5640 uregex_setUText(icu_re, utext_txt, &status); in Bug10459()
5648 int32_t len = uregex_group(icu_re, 0, buf, UPRV_LENGTHOF(buf), &status); in Bug10459()
5649 REGEX_ASSERT(status == U_REGEX_INVALID_STATE); in Bug10459()
5708 UErrorCode status = U_ZERO_ERROR; in TestCase11049() local
5710 LocalPointer<RegexPattern> compiledPat(RegexPattern::compile(patternString, 0, status)); in TestCase11049()
5714 dataString.extract(exactBuffer, dataString.length(), status); in TestCase11049()
5715 UText *ut = utext_openUChars(NULL, exactBuffer, dataString.length(), &status); in TestCase11049()
5717 LocalPointer<RegexMatcher> matcher(compiledPat->matcher(status)); in TestCase11049()
5731 …oUTF8(utf8Buffer, uprv_strlen(data)+1, NULL, dataString.getBuffer(), dataString.length(), &status); in TestCase11049()
5733 ut = utext_openUTF8(ut, utf8Buffer, -1, &status); in TestCase11049()
5753 UErrorCode status = U_ZERO_ERROR; in TestBug11371() local
5759 LocalPointer<RegexPattern> compiledPat(RegexPattern::compile(patternString, 0, status)); in TestBug11371()
5760 if (status != U_REGEX_PATTERN_TOO_BIG) { in TestBug11371()
5762 __FILE__, __LINE__, u_errorName(status)); in TestBug11371()
5765 status = U_ZERO_ERROR; in TestBug11371()
5771 LocalPointer<RegexPattern> compiledPat2(RegexPattern::compile(patternString, 0, status)); in TestBug11371()
5772 if (status != U_REGEX_PATTERN_TOO_BIG) { in TestBug11371()
5774 __FILE__, __LINE__, u_errorName(status)); in TestBug11371()
5779 status = U_ZERO_ERROR; in TestBug11371()
5785 LocalPointer<RegexPattern> compiledPat3(RegexPattern::compile(patternString, 0, status)); in TestBug11371()
5786 if (status != U_REGEX_PATTERN_TOO_BIG) { in TestBug11371()
5788 __FILE__, __LINE__, u_errorName(status)); in TestBug11371()
5797 UErrorCode status = U_ZERO_ERROR; in TestBug11480() local
5798 URegularExpression *re = uregex_openC("(A)|(B)", 0, NULL, &status); in TestBug11480()
5801 uregex_setText(re, text.getBuffer(), text.length(), &status); in TestBug11480()
5803 REGEX_ASSERT(uregex_lookingAt(re, 0, &status)); in TestBug11480()
5805 int32_t length = uregex_group(re, 2, buf+1, UPRV_LENGTHOF(buf)-1, &status); in TestBug11480()
5814 utext_openUnicodeString(&ut, &text, &status); in TestBug11480()
5815 RegexMatcher matcher(UnicodeString("(A)|(B)"), 0, status); in TestBug11480()
5818 REGEX_ASSERT(matcher.lookingAt(0, status)); in TestBug11480()
5823 matcher.group(1, &group, groupLen, status); in TestBug11480()
5829 matcher.group(2, &group, groupLen, status); in TestBug11480()
5832 REGEX_ASSERT(matcher.start(2, status) == -1); in TestBug11480()