Lines Matching refs:pattern
322 // REGEX_TESTLM("pattern", "input text", lookingAt expected, matches expected);
325 // The input text is unescaped. The pattern is not.
333 const UnicodeString pattern(pat, -1, US_INV);
394 UText pattern = UTEXT_INITIALIZER;
404 regextst_openUTF8FromInvariant(&pattern, pat, -1, &status);
405 REPattern = RegexPattern::compile(&pattern, 0, pe, status);
466 utext_close(&pattern);
479 // REGEX_ERR("pattern", expected error line, column, expected status);
486 UnicodeString pattern(pat);
493 // Compile the caller's pattern
498 dataerrln("Line %d: unexpected error %s compiling pattern.", line, u_errorName(status));
517 dataerrln("Line %d: unexpected error %s compiling pattern.", line, u_errorName(status));
535 // Basic Check for basic functionality of regex pattern matching.
551 RegexPattern *pattern;
552 pattern = RegexPattern::compile(UNICODE_STRING_SIMPLE("a\\u00dfx").unescape(), UREGEX_CASE_INSENSITIVE, pe, status);
553 pattern->dumpPattern();
554 RegexMatcher *m = pattern->matcher(UNICODE_STRING_SIMPLE("a\\u00dfxzzz").unescape(), status);
565 // Pattern with parentheses
611 // UnicodeSets in the pattern
697 UText pattern = UTEXT_INITIALIZER;
698 utext_openUTF8(&pattern, str_abc, -1, &status);
699 RegexMatcher matcher(&pattern, 0, status);
713 utext_close(&pattern);
740 // Simple pattern compilation
769 REGEX_ASSERT(&m1->pattern() == pat2);
981 // find, with \G in pattern (true if at the end of a previous match).
1018 RegexMatcher m("(?= ?)", 0, status); // This pattern will zero-length matches anywhere,
1047 // with pattern of /.?/, should see a series of one char matches, then a single
1228 // Adding the capturing parentheses to the pattern "(A)+A$" inhibits optimizations
1252 // A pattern that doesn't save state should work with
1533 // Verify that a matcher created from a cloned pattern works.
1630 // split, with a pattern with (capture)
1753 // RegexPattern::pattern()
1756 REGEX_ASSERT(pat1->pattern() == "");
1761 REGEX_ASSERT(pat1->pattern() == "(Hello, world)*");
1804 // Simple pattern compilation
2150 // find, with \G in pattern (true if at the end of a previous match).
2195 RegexMatcher m("(?= ?)", 0, status); // This pattern will zero-length matches anywhere,
2228 // with pattern of /.?/, should see a series of one char matches, then a single
2821 // Verify that a matcher created from a cloned pattern works.
2826 UText pattern = UTEXT_INITIALIZER;
2828 utext_openUTF8(&pattern, str_pL, -1, &status);
2830 RegexPattern *pSource = RegexPattern::compile(&pattern, 0, status);
2849 utext_close(&pattern);
2857 UText pattern = UTEXT_INITIALIZER;
2864 utext_openUTF8(&pattern, str_dotstar, -1, &status);
2865 REGEX_ASSERT(RegexPattern::matches(&pattern, &input, pe, status) == TRUE);
2869 utext_openUTF8(&pattern, str_abc, -1, &status);
2874 utext_openUTF8(&pattern, str_nput, -1, &status);
2878 utext_openUTF8(&pattern, str_randominput, -1, &status);
2883 utext_openUTF8(&pattern, str_u, -1, &status);
2888 utext_openUTF8(&pattern, str_abc, -1, &status);
2894 utext_close(&pattern);
2961 // split, with a pattern with (capture)
3088 // RegexPattern::pattern() and patternText()
3091 REGEX_ASSERT(pat1->pattern() == "");
3098 REGEX_ASSERT_UNISTR("(Hello, world)*", pat1->pattern());
3159 UnicodeString testPattern; // The pattern for test from the test file.
3186 // Separate out the three main fields - pattern, flags, target.
3196 // Pull out the pattern field, remove it from the test file line.
3203 errln("Bad pattern (missing quotes?) at %s:%d", srcPath, lineNum);
3257 // regex_find(pattern, flags, inputString, lineNumber)
3261 // pattern and inputString fields, and the allowed flags.
3307 void RegexTest::regex_find(const UnicodeString &pattern,
3344 // Compile the caller's pattern
3371 callerPattern = RegexPattern::compile(pattern, bflags, pe, status);
3374 // 'v' test flag means that the test pattern should not compile if ICU was configured
3381 // Expected pattern compilation error.
3383 logln("Pattern Compile returns \"%s\"", u_errorName(status));
3387 // Unexpected pattern compilation error.
3388 dataerrln("Line %d: error %s compiling pattern.", line, u_errorName(status));
3396 patternUTF8Length = pattern.extract(NULL, 0, UTF8Converter, status);
3399 pattern.extract(patternChars, patternUTF8Length+1, UTF8Converter, status);
3407 // 'v' test flag means that the test pattern should not compile if ICU was configured
3414 // Expected pattern compilation error.
3416 logln("Pattern Compile returns \"%s\" (UTF8)", u_errorName(status));
3420 // Unexpected pattern compilation error.
3421 errln("Line %d: error %s compiling pattern. (UTF8)", line, u_errorName(status));
3429 logln("Unable to create UTF-8 pattern, skipping UTF-8 tests for %s:%d", srcPath, line);
3438 errln("%s, Line %d: Expected, but did not get, a pattern compilation error.", srcPath, line);
3594 // Do a find on the de-tagged input using the caller's pattern
3741 infoln((UnicodeString)"\""+pattern+(UnicodeString)"\" "
3946 // # Column 1 contains the pattern, optionally enclosed in C<''>.
4022 // Test patterns with flags look like 'pattern'i
4023 // Test patterns without flags are not quoted: pattern
4024 // Coming out, capture group 2 is the pattern, capture group 3 is the flags.
4070 UnicodeString pattern = flagMat->group(2, status);
4071 pattern.findAndReplace("${bang}", "!");
4072 pattern.findAndReplace(nulnulSrc, UNICODE_STRING_SIMPLE("\\u0000\\u0000"));
4073 pattern.findAndReplace(ffffSrc, ffff);
4101 // Compile the test pattern.
4104 RegexPattern *testPat = RegexPattern::compile(pattern, flags, pe, status);
4135 // This pattern should have caused a compilation error, but didn't/
4136 errln("line %d: Expected a pattern compile error, got success.", lineNum);
4391 // Test patterns with flags look like 'pattern'i
4392 // Test patterns without flags are not quoted: pattern
4393 // Coming out, capture group 2 is the pattern, capture group 3 is the flags.
4439 UnicodeString pattern = flagMat->group(2, status);
4440 pattern.findAndReplace("${bang}", "!");
4441 pattern.findAndReplace(nulnulSrc, UNICODE_STRING_SIMPLE("\\u0000\\u0000"));
4442 pattern.findAndReplace(ffffSrc, ffff);
4470 // Put the pattern in a UTF-8 UText
4473 patternLength = pattern.extract(patternChars, patternCapacity, UTF8Converter.getAlias(), status);
4479 pattern.extract(patternChars, patternCapacity, UTF8Converter.getAlias(), status);
4484 // Compile the test pattern.
4517 // This pattern should have caused a compilation error, but didn't/
4518 errln("line %d: Expected a pattern compile error, got success.", lineNum);
4724 // Use this pattern,
4732 UnicodeString pattern("(a?){1,8000000}");
4737 RegexMatcher matcher(pattern, s, flags, status);
4796 RegexMatcher matcher(UNICODE_STRING_SIMPLE("((.)+\\2)+x"), 0, status); // A pattern that can run long.
5198 // After copying a pattern, named capture should still work in the copy.
5216 // m.pattern().dumpPattern();
5404 const int32_t goodLimit = 1000000; // Pattern w this many groups builds successfully.
5405 const int32_t failLimit = 10000000; // Pattern exceeds internal limits, fails to compile.
5407 UnicodeString pattern;
5412 pattern.append(UnicodeString(nnbuf, -1, US_INV));
5415 RegexPattern *pat = RegexPattern::compile(pattern, 0, status);
5427 pattern.remove();
5430 pattern.append(UnicodeString(nnbuf, -1, US_INV));
5433 pat = RegexPattern::compile(pattern, 0, status);
5441 // Bug7651 Regex pattern that exceeds default operator stack depth in matcher.
5447 // It will cause a segfault if RegexMatcher tries to use fSmallData instead of malloc'ing the memory needed (see init2) for the pattern operator stack allocation.
5478 UnicodeString pattern = "(a)";
5480 RegexMatcher *m = new RegexMatcher(pattern, text, 0, status);
5627 // Original bug report: pattern with match start consisting of one of several individual characters,
5637 // Test again with a pattern starting with a single character,
5645 void RegexTest::TestCase11049(const char *pattern, const char *data, UBool expectMatch, int32_t lineNumber) {
5647 UnicodeString patternString = UnicodeString(pattern).unescape();
5660 errln("File %s, line %d: expected %d, got %d. Pattern = \"%s\", text = \"%s\"",
5661 __FILE__, lineNumber, expectMatch, result, pattern, data);
5676 errln("File %s, line %d (UTF-8 check): expected %d, got %d. Pattern = \"%s\", text = \"%s\"",
5677 __FILE__, lineNumber, expectMatch, result, pattern, data);
5715 Pattern with too much string data, such that string indexes overflow operand data field size
5776 UnicodeString pattern(u"(((((((){120}){11}){11}){11}){80}){11}){4}");
5779 RegexMatcher m(pattern, text, 0, status);
5811 // Bug 13631. A find() of a pattern with a zero length look-behind assertions