Lines Matching refs:re
48 * 're" is the compiled, ready-to-go regular expression.
53 re = uregex_openC(pattern, flags, NULL, &status); \
57 uregex_setText(re, srcString, -1, &status); \
64 uregex_close(re); \
203 URegularExpression *re;
211 re = uregex_open(pat, -1, 0, 0, &status);
216 uregex_close(re);
220 re = uregex_open(pat, -1,
224 uregex_close(re);
228 re = uregex_open(pat, -1, 0x40000000, 0, &status);
230 uregex_close(re);
234 re = uregex_open(pat, -1, UREGEX_CANON_EQ, 0, &status);
236 uregex_close(re);
240 re = uregex_openC(NULL,
242 TEST_ASSERT(status == U_ILLEGAL_ARGUMENT_ERROR && re == NULL);
246 re = uregex_openC(NULL,
248 TEST_ASSERT(status == U_USELESS_COLLATOR_ERROR && re == NULL);
255 re = uregex_openC("abc*", 0, 0, &status);
257 p = uregex_pattern(re, &len, &status);
267 uregex_close(re);
285 re = uregex_openC("abc*", 0, 0, &status);
287 clone1 = uregex_clone(re, &status);
292 clone2 = uregex_clone(re, &status);
295 uregex_close(re);
336 re = uregex_open(pat, -1, 0, NULL, &status);
337 resultPat = uregex_pattern(re, &resultLen, &status);
346 uregex_close(re);
349 re = uregex_open(pat, 3, 0, NULL, &status);
350 resultPat = uregex_pattern(re, &resultLen, &status);
361 uregex_close(re);
371 re = uregex_open(pat, -1, 0, NULL, &status);
372 t = uregex_flags(re, &status);
375 uregex_close(re);
378 re = uregex_open(pat, -1, 0, NULL, &status);
379 t = uregex_flags(re, &status);
382 uregex_close(re);
385 re = uregex_open(pat, -1, UREGEX_CASE_INSENSITIVE | UREGEX_DOTALL, NULL, &status);
386 t = uregex_flags(re, &status);
389 uregex_close(re);
404 re = uregex_open(pat, -1, 0, NULL, &status);
409 uregex_lookingAt(re, 0, &status);
413 uregex_setText(re, text1, -1, &status);
414 result = uregex_lookingAt(re, 0, &status);
419 uregex_setText(re, text2, -1, &status);
420 result = uregex_lookingAt(re, 0, &status);
425 uregex_setText(re, text1, -1, &status);
426 result = uregex_lookingAt(re, 0, &status);
431 uregex_setText(re, text1, 5, &status);
432 result = uregex_lookingAt(re, 0, &status);
437 uregex_setText(re, text1, 6, &status);
438 result = uregex_lookingAt(re, 0, &status);
442 uregex_close(re);
459 re = uregex_open(pat, -1, 0, NULL, &status);
461 uregex_setText(re, text1, -1, &status);
462 result = uregex_getText(re, &textLength, &status);
468 uregex_setText(re, text2, 7, &status);
469 result = uregex_getText(re, &textLength, &status);
475 uregex_setText(re, text2, 4, &status);
476 result = uregex_getText(re, &textLength, &status);
480 uregex_close(re);
495 re = uregex_open(pat, -1, 0, NULL, &status);
497 uregex_setText(re, text1, -1, &status);
498 result = uregex_matches(re, 0, &status);
503 uregex_setText(re, text1, 6, &status);
504 result = uregex_matches(re, 0, &status);
509 uregex_setText(re, text1, 6, &status);
510 result = uregex_matches(re, 1, &status);
513 uregex_close(re);
516 re = uregex_openC(".?", 0, NULL, &status);
517 uregex_setText(re, text1, -1, &status);
519 result = uregex_matches(re, len, &status);
524 uregex_setText(re, nullString, -1, &status);
526 result = uregex_matches(re, 0, &status);
529 uregex_close(re);
546 re = uregex_openC("rx", 0, NULL, &status);
548 uregex_setText(re, text1, -1, &status);
549 result = uregex_find(re, 0, &status);
551 TEST_ASSERT(uregex_start(re, 0, &status) == 3);
552 TEST_ASSERT(uregex_end(re, 0, &status) == 5);
555 result = uregex_find(re, 9, &status);
557 TEST_ASSERT(uregex_start(re, 0, &status) == 11);
558 TEST_ASSERT(uregex_end(re, 0, &status) == 13);
561 result = uregex_find(re, 14, &status);
566 uregex_reset(re, 0, &status);
568 result = uregex_findNext(re, &status);
570 TEST_ASSERT(uregex_start(re, 0, &status) == 3);
571 TEST_ASSERT(uregex_end(re, 0, &status) == 5);
574 result = uregex_findNext(re, &status);
576 TEST_ASSERT(uregex_start(re, 0, &status) == 6);
577 TEST_ASSERT(uregex_end(re, 0, &status) == 8);
581 uregex_reset(re, 12, &status);
583 result = uregex_findNext(re, &status);
585 TEST_ASSERT(uregex_start(re, 0, &status) == 13);
586 TEST_ASSERT(uregex_end(re, 0, &status) == 15);
589 result = uregex_findNext(re, &status);
593 uregex_close(re);
603 re = uregex_openC("abc", 0, NULL, &status);
604 result = uregex_groupCount(re, &status);
607 uregex_close(re);
610 re = uregex_openC("abc(def)(ghi(j))", 0, NULL, &status);
611 result = uregex_groupCount(re, &status);
614 uregex_close(re);
630 re = uregex_openC("abc(.*?)def", 0, NULL, &status);
634 uregex_setText(re, text1, -1, &status);
635 result = uregex_find(re, 0, &status);
640 resultSz = uregex_group(re, 0, buf, UPRV_LENGTHOF(buf), &status);
647 resultSz = uregex_group(re, 1, buf, UPRV_LENGTHOF(buf), &status);
654 uregex_group(re, 2, buf, UPRV_LENGTHOF(buf), &status);
659 resultSz = uregex_group(re, 0, NULL, 0, &status);
666 resultSz = uregex_group(re, 0, buf, 5, &status);
674 resultSz = uregex_group(re, 0, buf, (int32_t)strlen("abc interior def"), &status);
680 uregex_close(re);
692 TEST_ASSERT(uregex_regionStart(re, &status) == 0);
693 TEST_ASSERT(uregex_regionEnd(re, &status) == 16);
694 uregex_setRegion(re, 3, 6, &status);
695 TEST_ASSERT(uregex_regionStart(re, &status) == 3);
696 TEST_ASSERT(uregex_regionEnd(re, &status) == 6);
697 TEST_ASSERT(uregex_findNext(re, &status));
698 TEST_ASSERT(uregex_group(re, 0, resultString, UPRV_LENGTHOF(resultString), &status) == 3)
704 uregex_setRegion(re, 4, 6, &status);
705 TEST_ASSERT(uregex_find(re, -1, &status) == TRUE);
706 TEST_ASSERT(uregex_start(re, 0, &status) == 4);
707 TEST_ASSERT(uregex_end(re, 0, &status) == 6);
712 uregex_setRegion(re, 4, 6, &status);
713 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE);
714 TEST_ASSERT(uregex_start(re, 0, &status) == 0);
715 TEST_ASSERT(uregex_end(re, 0, &status) == 16);
720 uregex_setRegion(re, 4, 6, &status);
721 TEST_ASSERT(uregex_findNext(re,&status) == TRUE);
722 TEST_ASSERT(uregex_start(re, 0, &status) == 4);
723 TEST_ASSERT(uregex_findNext(re, &status) == TRUE);
724 TEST_ASSERT(uregex_start(re, 0, &status) == 5);
725 TEST_ASSERT(uregex_findNext(re, &status) == FALSE);
731 uregex_setRegion(re, 4, 6, &status);
732 TEST_ASSERT(uregex_matches(re, -1, &status) == TRUE);
733 TEST_ASSERT(uregex_start(re, 0, &status) == 4);
734 TEST_ASSERT(uregex_end(re, 0, &status) == 6);
739 uregex_setRegion(re, 4, 6, &status);
740 TEST_ASSERT(uregex_matches(re, 0, &status) == TRUE);
741 TEST_ASSERT(uregex_start(re, 0, &status) == 0);
742 TEST_ASSERT(uregex_end(re, 0, &status) == 16);
748 uregex_setRegion(re, 4, 6, &status);
749 TEST_ASSERT(uregex_lookingAt(re, -1, &status) == TRUE);
750 TEST_ASSERT(uregex_start(re, 0, &status) == 4);
751 TEST_ASSERT(uregex_end(re, 0, &status) == 4);
756 uregex_setRegion(re, 4, 6, &status);
757 TEST_ASSERT(uregex_lookingAt(re, 0, &status) == TRUE);
758 TEST_ASSERT(uregex_start(re, 0, &status) == 0);
759 TEST_ASSERT(uregex_end(re, 0, &status) == 0);
764 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE);
765 TEST_ASSERT(uregex_hitEnd(re, &status) == FALSE);
769 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE);
770 TEST_ASSERT(uregex_hitEnd(re, &status) == TRUE);
775 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE);
776 TEST_ASSERT(uregex_requireEnd(re, &status) == FALSE);
780 TEST_ASSERT(uregex_find(re, 0, &status) == TRUE);
781 TEST_ASSERT(uregex_requireEnd(re, &status) == TRUE);
786 TEST_ASSERT(uregex_hasAnchoringBounds(re, &status) == TRUE);
787 uregex_useAnchoringBounds(re, FALSE, &status);
788 TEST_ASSERT(uregex_hasAnchoringBounds(re, &status) == FALSE);
790 TEST_ASSERT(uregex_find(re, -1, &status) == FALSE);
791 uregex_useAnchoringBounds(re, TRUE, &status);
792 uregex_setRegion(re, 0, 3, &status);
793 TEST_ASSERT(uregex_find(re, -1, &status) == TRUE);
794 TEST_ASSERT(uregex_end(re, 0, &status) == 3);
799 TEST_ASSERT(uregex_hasTransparentBounds(re, &status) == FALSE);
800 uregex_useTransparentBounds(re, TRUE, &status);
801 TEST_ASSERT(uregex_hasTransparentBounds(re, &status) == TRUE);
803 uregex_useTransparentBounds(re, FALSE, &status);
804 TEST_ASSERT(uregex_find(re, -1, &status) == TRUE); /* No Region */
805 uregex_setRegion(re, 0, 3, &status);
806 TEST_ASSERT(uregex_find(re, -1, &status) == FALSE); /* with region, opaque bounds */
807 uregex_useTransparentBounds(re, TRUE, &status);
808 TEST_ASSERT(uregex_find(re, -1, &status) == TRUE); /* with region, transparent bounds */
809 TEST_ASSERT(uregex_end(re, 0, &status) == 3);
827 re = uregex_openC("x(.*?)x", 0, NULL, &status);
831 uregex_setText(re, text1, -1, &status);
832 resultSz = uregex_replaceFirst(re, replText, -1, buf, UPRV_LENGTHOF(buf), &status);
839 uregex_setText(re, text2, -1, &status);
840 resultSz = uregex_replaceFirst(re, replText, -1, buf, UPRV_LENGTHOF(buf), &status);
847 uregex_setText(re, text1, -1, &status);
849 resultSz = uregex_replaceFirst(re, replText, -1, buf, strlen("Replace <aa> x1x x...x."), &status);
860 resultSz = uregex_replaceFirst(re, replText, -1, buf, strlen("Replace <aa> x1x x...x."), &status);
868 resultSz = uregex_replaceFirst(re, replText, -1, NULL, 0, &status);
875 resultSz = uregex_replaceFirst(re, replText, -1, buf, strlen("Replace <aa> x1x x...x.")-1, &status);
881 uregex_close(re);
910 re = uregex_openC(pattern, 0, NULL, &status);
914 uregex_setText(re, text1, -1, &status);
915 resultSize = uregex_replaceAll(re, replText, -1, buf, UPRV_LENGTHOF(buf), &status);
922 uregex_setText(re, text2, -1, &status);
923 resultSize = uregex_replaceAll(re, replText, -1, buf, UPRV_LENGTHOF(buf), &status);
930 uregex_setText(re, text1, -1, &status);
932 resultSize = uregex_replaceAll(re, replText, -1, buf, expectedResultSize, &status);
943 resultSize = uregex_replaceAll(re, replText, -1, buf, strlen("Replace xaax x1x x...x."), &status);
951 resultSize = uregex_replaceAll(re, replText, -1, NULL, 0, &status);
961 resultSize = uregex_replaceAll(re, replText, -1, buf, i, &status);
978 resultSize = uregex_replaceAll(re, replText2, -1, buf, i, &status);
988 uregex_close(re);
1004 re = uregex_openC(".*", 0, 0, &status);
1009 uregex_setText(re, text, -1, &status);
1012 uregex_find(re, 0, &status);
1016 uregex_appendReplacement(re, repl, -1, &bufPtr, &bufCap, &status);
1021 uregex_find(re, 0, &status);
1026 uregex_appendReplacement(re, repl, -1, &bufPtr, &bufCap, &status);
1032 uregex_find(re, 0, &status);
1036 uregex_appendReplacement(re, repl, -1, &bufPtr, NULL, &status);
1039 uregex_close(re);
1064 re = uregex_openC(":", 0, NULL, &status);
1069 uregex_setText(re, textToSplit, -1, &status);
1076 uregex_split(re, buf, UPRV_LENGTHOF(buf), &requiredCapacity, fields, 10, &status);
1095 uregex_close(re);
1100 re = uregex_openC(":", 0, NULL, &status);
1101 uregex_setText(re, textToSplit, -1, &status);
1108 uregex_split(re, buf, UPRV_LENGTHOF(buf), &requiredCapacity, fields, 2, &status);
1133 uregex_split(re, buf, sz, &requiredCapacity, fields, 10, &status);
1149 uregex_close(re);
1169 re = uregex_openC("<(.*?)>", 0, NULL, &status);
1171 uregex_setText(re, textToSplit, -1, &status);
1178 uregex_split(re, buf, UPRV_LENGTHOF(buf), &requiredCapacity, fields, 10, &status);
1199 uregex_split(re, buf, UPRV_LENGTHOF(buf), &requiredCapacity, fields, 2, &status);
1217 uregex_split(re, buf, UPRV_LENGTHOF(buf), &requiredCapacity, fields, 3, &status);
1236 uregex_split(re, buf, UPRV_LENGTHOF(buf), &requiredCapacity, fields, 5, &status);
1256 uregex_setText(re, textToSplit, sz, &status);
1263 uregex_split(re, buf, UPRV_LENGTHOF(buf), &requiredCapacity, fields, 9, &status);
1282 uregex_close(re);
1289 TEST_ASSERT(uregex_getTimeLimit(re, &status) == 0);
1290 uregex_setTimeLimit(re, 1000, &status);
1291 TEST_ASSERT(uregex_getTimeLimit(re, &status) == 1000);
1293 uregex_setTimeLimit(re, -1, &status);
1296 TEST_ASSERT(uregex_getTimeLimit(re, &status) == 1000);
1303 TEST_ASSERT(uregex_getStackLimit(re, &status) == 8000000);
1304 uregex_setStackLimit(re, 40000, &status);
1305 TEST_ASSERT(uregex_getStackLimit(re, &status) == 40000);
1307 uregex_setStackLimit(re, -1, &status);
1310 TEST_ASSERT(uregex_getStackLimit(re, &status) == 40000);
1327 uregex_getMatchCallback(re, &returnedFn, &pContext, &status);
1334 uregex_setMatchCallback(re, &TestCallbackFn, &cbInfo, &status);
1337 TEST_ASSERT(uregex_matches(re, -1, &status) == FALSE);
1342 uregex_getMatchCallback(re, &returnedFn, &pContext, &status);
1405 URegularExpression *re;
1412 re = uregex_openUText(&patternText, 0, 0, &status);
1418 uregex_close(re);
1422 re = uregex_openUText(&patternText,
1426 uregex_close(re);
1430 re = uregex_openUText(&patternText, 0x40000000, 0, &status);
1432 uregex_close(re);
1436 re = uregex_openUText(NULL,
1438 TEST_ASSERT(status == U_ILLEGAL_ARGUMENT_ERROR && re == NULL);
1453 re = uregex_openUText(&patternText, 0, 0, &status);
1455 clone1 = uregex_clone(re, &status);
1460 clone2 = uregex_clone(re, &status);
1463 uregex_close(re);
1509 re = uregex_open(pat, -1, 0, NULL, &status);
1510 resultPat = uregex_pattern(re, &resultLen, &status);
1519 resultText = uregex_patternUText(re, &status);
1523 uregex_close(re);
1526 re = uregex_open(pat, 3, 0, NULL, &status);
1527 resultPat = uregex_pattern(re, &resultLen, &status);
1537 resultText = uregex_patternUText(re, &status);
1541 uregex_close(re);
1559 re = uregex_openUText(&patternText, 0, NULL, &status);
1564 uregex_lookingAt(re, 0, &status);
1568 uregex_setUText(re, &text1, &status);
1569 result = uregex_lookingAt(re, 0, &status);
1574 uregex_setUText(re, &text2, &status);
1575 result = uregex_lookingAt(re, 0, &status);
1580 uregex_setUText(re, &text1, &status);
1581 result = uregex_lookingAt(re, 0, &status);
1585 uregex_close(re);
1612 re = uregex_openUText(&patternText, 0, NULL, &status);
1615 uregex_setUText(re, &text1, &status);
1616 resultText = uregex_getUText(re, NULL, &status);
1624 result = uregex_getText(re, &textLength, &status); /* flattens UText into buffer */
1627 resultText = uregex_getUText(re, NULL, &status);
1636 uregex_setText(re, text2Chars, 7, &status);
1637 resultText = uregex_getUText(re, NULL, &status);
1643 result = uregex_getText(re, &textLength, &status);
1646 uregex_close(re);
1664 re = uregex_openUText(&patternText, 0, NULL, &status);
1666 uregex_setUText(re, &text1, &status);
1667 result = uregex_matches(re, 0, &status);
1670 uregex_close(re);
1673 re = uregex_openC(".?", 0, NULL, &status);
1674 uregex_setUText(re, &text1, &status);
1675 result = uregex_matches(re, 7, &status);
1681 uregex_setUText(re, &nullText, &status);
1683 result = uregex_matches(re, 0, &status);
1687 uregex_close(re);
1706 re = uregex_openC("rx", 0, NULL, &status);
1708 uregex_setText(re, text1, -1, &status);
1709 result = uregex_find(re, 0, &status);
1711 TEST_ASSERT(uregex_start(re, 0, &status) == 3);
1712 TEST_ASSERT(uregex_end(re, 0, &status) == 5);
1715 result = uregex_find(re, 9, &status);
1717 TEST_ASSERT(uregex_start(re, 0, &status) == 11);
1718 TEST_ASSERT(uregex_end(re, 0, &status) == 13);
1721 result = uregex_find(re, 14, &status);
1726 uregex_reset(re, 0, &status);
1728 result = uregex_findNext(re, &status);
1730 TEST_ASSERT(uregex_start(re, 0, &status) == 3);
1731 TEST_ASSERT(uregex_end(re, 0, &status) == 5);
1734 result = uregex_findNext(re, &status);
1736 TEST_ASSERT(uregex_start(re, 0, &status) == 6);
1737 TEST_ASSERT(uregex_end(re, 0, &status) == 8);
1741 uregex_reset(re, 12, &status);
1743 result = uregex_findNext(re, &status);
1745 TEST_ASSERT(uregex_start(re, 0, &status) == 13);
1746 TEST_ASSERT(uregex_end(re, 0, &status) == 15);
1749 result = uregex_findNext(re, &status);
1753 uregex_close(re);
1769 re = uregex_openC("abc(.*?)def", 0, NULL, &status);
1772 uregex_setText(re, text1, -1, &status);
1773 result = uregex_find(re, 0, &status);
1778 actual = uregex_groupUText(re, 0, NULL, &groupLen, &status);
1791 actual = uregex_groupUText(re, 1, NULL, &groupLen, &status);
1803 actual = uregex_groupUText(re, 2, NULL, &groupLen, &status);
1807 uregex_close(re);
1829 re = uregex_openC("x(.*?)x", 0, NULL, &status);
1833 uregex_setText(re, text1, -1, &status);
1834 result = uregex_replaceFirstUText(re, &replText, NULL, &status);
1840 uregex_setText(re, text2, -1, &status);
1841 result = uregex_replaceFirstUText(re, &replText, NULL, &status);
1847 uregex_setText(re, text1, -1, &status);
1849 result = uregex_replaceFirstUText(re, &replText, NULL, &status);
1854 uregex_close(re);
1875 re = uregex_openC("x(.*?)x", 0, NULL, &status);
1879 uregex_setText(re, text1, -1, &status);
1880 result = uregex_replaceAllUText(re, &replText, NULL, &status);
1886 uregex_setText(re, text2, -1, &status);
1887 result = uregex_replaceAllUText(re, &replText, NULL, &status);
1892 uregex_close(re);
1908 re = uregex_openC(".*", 0, 0, &status);
1913 uregex_setText(re, text, -1, &status);
1916 uregex_find(re, 0, &status);
1920 uregex_appendReplacement(re, repl, -1, &bufPtr, &bufCap, &status);
1925 uregex_find(re, 0, &status);
1930 uregex_appendReplacement(re, repl, -1, &bufPtr, &bufCap, &status);
1934 uregex_close(re);
1956 re = uregex_openC(":", 0, NULL, &status);
1961 uregex_setText(re, textToSplit, -1, &status);
1967 numFields = uregex_splitUText(re, fields, 10, &status);
1986 uregex_close(re);
1991 re = uregex_openC(":", 0, NULL, &status);
1992 uregex_setText(re, textToSplit, -1, &status);
2000 numFields = uregex_splitUText(re, fields, 2, &status);
2017 uregex_close(re);
2031 re = uregex_openC("<(.*?)>", 0, NULL, &status);
2033 uregex_setText(re, textToSplit, -1, &status);
2039 numFields = uregex_splitUText(re, fields, 10, &status);
2068 numFields = uregex_splitUText(re, fields, 2, &status);
2091 numFields = uregex_splitUText(re, fields, 3, &status);
2117 numFields = uregex_splitUText(re, fields, 5, &status);
2142 uregex_setText(re, textToSplit, strlen("first <tag-a> second<tag-b>"), &status);
2149 numFields = uregex_splitUText(re, fields, 9, &status);
2175 uregex_close(re);
2192 URegularExpression *re;
2196 re = uregex_openC("[ABC]", 0, 0, &status);
2201 uregex_setUText(re, &ut1, &status);
2205 TEST_ASSERT(uregex_findNext(re, &status));
2206 TEST_ASSERT(uregex_start(re, 0, &status) == 0);
2213 uregex_refreshUText(re, &ut2, &status);
2217 TEST_ASSERT(uregex_findNext(re, &status));
2218 TEST_ASSERT(uregex_start(re, 0, &status) == 2);
2219 TEST_ASSERT(uregex_findNext(re, &status));
2220 TEST_ASSERT(uregex_start(re, 0, &status) == 4);
2221 TEST_ASSERT(FALSE == uregex_findNext(re, &status));
2223 uregex_close(re);
2231 URegularExpression *re;
2235 re = uregex_openC("abc", 0, 0, &status);
2238 limit = uregex_getTimeLimit(re, &status);
2242 uregex_setTimeLimit(re, 100, &status);
2244 limit = uregex_getTimeLimit(re, &status);
2248 uregex_close(re);
2263 URegularExpression *re;
2270 re = uregex_openC(".z", 0, 0, &status);
2274 uregex_setText(re, text, -1, &status);
2277 uregex_setFindProgressCallback(re, FindCallback, NULL, &status);
2280 uregex_findNext(re, &status);
2283 uregex_close(re);
2288 re = uregex_openC("((xxx)*)*y", 0, 0, &status);
2294 uregex_setText(re, text, -1, &status);
2297 uregex_setMatchCallback(re, MatchCallback, NULL, &status);
2300 uregex_findNext(re, &status);
2303 uregex_close(re);