Home
last modified time | relevance | path

Searched refs:matcher (Results 1 – 25 of 50) sorted by relevance

12

/libcore/ojluni/src/test/java/util/regex/
DRegExTest.java127 assertEquals(p.matcher(s).find(), expected); in check()
131 Matcher matcher = Pattern.compile(p).matcher(s); in check() local
132 assertEquals(matcher.find(), expected); in check()
139 Matcher matcher = pattern.matcher(new String(ca)); in check() local
140 assertTrue(matcher.find()); in check()
147 Matcher matcher = pattern.matcher(new String(ca)); in check() local
148 assertTrue(matcher.find()); in check()
155 Matcher matcher = pattern.matcher(input); in check() local
157 check(matcher, s, expected); in check()
163 Matcher m = p.matcher(s); in check()
[all …]
DPatternStreamTest.java163 String expected = pattern.matcher(input).replaceFirst("R"); in testReplaceFirst()
164 String actual = pattern.matcher(input).replaceFirst(r -> "R"); in testReplaceFirst()
171 String expected = pattern.matcher(input).replaceAll("R"); in testReplaceAll()
172 String actual = pattern.matcher(input).replaceAll(r -> "R"); in testReplaceAll()
176 Matcher m = pattern.matcher(input); in testReplaceAll()
182 pattern.matcher(input).replaceAll(r -> "R" + actualMatches.incrementAndGet()); in testReplaceAll()
189 Matcher m = pattern.matcher(input); in testMatchResults()
195 Supplier<Stream<MatchResult>> ss = () -> pattern.matcher(input).results(); in testMatchResults()
218 Matcher m = p.matcher("XX"); in testFailfastMatchResults()
264 Matcher m = p.matcher("XX"); in testFailfastReplace()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/regex/
DPattern2Test.java33 Matcher m1 = p.matcher("foo123"); in testSimpleMatch()
38 Matcher m2 = p.matcher("fox"); in testSimpleMatch()
58 m = p.matcher("foobar"); in testCursors()
112 m = p.matcher("p1#q3p2q42p5p71p63#q888"); in testGroups()
167 m = p.matcher("aabfooaabfooabfoob"); in testReplace()
181 m = p.matcher("Byte for byte"); in testReplace()
187 m = p.matcher("card #1234-5678-1234"); in testReplace()
193 m = p.matcher("left right, up down"); in testReplace()
199 m = p.matcher("I want cheese. Please."); in testReplace()
212 m = p.matcher("fred\\ginger;abbott\\costello;jekell\\hyde;"); in testEscapes()
[all …]
DMatcherTest.java45 Matcher m = p.matcher("axxxxxa"); in testRegionsIntInt()
80 Matcher m = pat.matcher("Today is XX-XX-XX ..."); in testAppendReplacement()
92 Matcher m = p.matcher("xx $ equals to xx rur."); in testAppendReplacementRef()
106 Matcher mat = pat.matcher(input); in testReplaceAll()
113 Matcher m = p.matcher("abcd"); in testResetCharSequence()
127 Matcher m = p.matcher("one\\cat\\two\\cats\\in\\the\\yard"); in testAppendSlashes()
141 Matcher mat = pat.matcher(input); in testReplaceFirst()
147 Matcher matcher = Pattern.compile("Hello").matcher("Hello, world!"); in testReplaceFirst_null_match() local
149 matcher.replaceFirst((String) null); in testReplaceFirst_null_match()
156 Matcher matcher = Pattern.compile("not found").matcher("Hello, world!"); in testReplaceFirst_null_nomatch() local
[all …]
DModeTest.java36 m = p.matcher("cAT123#dog345"); in testCase()
43 m = p.matcher("cAt123#doG345"); in testCase()
52 m = p.matcher("cAt123#doG345"); in testCase()
65 m = p.matcher("foobar"); in testMultiline()
70 m = p.matcher("barfoo"); in testMultiline()
75 m = p.matcher("foobar"); in testMultiline()
78 m = p.matcher("barfoo"); in testMultiline()
85 m = p.matcher("foo1bar\nfoo2foo3\nbarfoo4"); in testMultiline()
94 m = p.matcher("foo1bar\nfoo2foo3\nbarfoo4"); in testMultiline()
103 m = p.matcher("foo1bar\nfoo2foo3\nbarfoo4"); in testMultiline()
[all …]
DMatcher2Test.java32 Matcher m = p.matcher("bar"); in test_toString()
39 Matcher m = p.matcher("bar"); in testErrorConditions()
90 Matcher m = p.matcher("foo1barzfoo2baryfoozbar5"); in testErrorConditions2()
224 Matcher mat = pat.matcher(str); in testReplacementBackSlash()
233 Matcher matcher = Pattern.compile("Hello").matcher("Hello, world!"); in testAppendReplacement_replacementEndsWithBackslash() local
234 matcher.find(); in testAppendReplacement_replacementEndsWithBackslash()
236 matcher.appendReplacement(new StringBuffer(), "replacement\\"); in testAppendReplacement_replacementEndsWithBackslash()
243 Matcher matcher = Pattern.compile("Hello").matcher("Hello, world!"); in testAppendReplacement_replacementEndsWithDollar() local
244 matcher.find(); in testAppendReplacement_replacementEndsWithDollar()
246 matcher.appendReplacement(new StringBuffer(), "replacement$"); in testAppendReplacement_replacementEndsWithDollar()
DReplaceTest.java36 Matcher m = p.matcher(target); in testSimpleReplace()
52 m = p.matcher(target); in testCaptureReplace()
62 m = p.matcher(target); in testCaptureReplace()
/libcore/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/
DPattern2Test.java119 "by pattern '"+pat, p.matcher(t).matches()); in testCategory()
121 "be matched by pattern '"+npat, pn.matcher(t).matches()); in testCategory()
124 "by pattern '"+pat, p.matcher(t).matches()); in testCategory()
126 "not be matched by pattern '"+npat, pn.matcher(t).matches()); in testCategory()
137 m = p.matcher("aaaaaaaab"); in testCapturingGroups()
143 m = p.matcher("ananas"); in testCapturingGroups()
154 m = p.matcher("ananas"); in testCapturingGroups()
173 m = p.matcher("ananasanan"); in testCapturingGroups()
190 m = p.matcher("abcc"); in testRepeats()
192 m = p.matcher("c"); in testRepeats()
[all …]
DPatternTest.java92 assertNotNull(p.matcher("bcde")); in testMatcher()
93 assertNotSame(p.matcher("a"), p.matcher("a")); in testMatcher()
304 Matcher mat = pat.matcher(testString); in testFlagsCase1()
312 Matcher mat = pat.matcher(testString); in testFlagsCase2()
320 Matcher mat = pat.matcher(testString); in testFlagsCase3()
328 Matcher mat = pat.matcher(testString); in testFlagsCase4()
336 Matcher mat = pat.matcher(testString); in testFlagsCase5()
344 Matcher mat = pat.matcher(testString); in testFlagsCase6()
352 Matcher mat = pat.matcher(testString); in testFlagsCase7()
360 Matcher mat = pat.matcher(testString); in testFlagsCase8()
[all …]
/libcore/luni/src/test/java/libcore/java/util/regex/
DOldMatcherTest.java32 Matcher m = pat.matcher("Today is XX-XX-XX ..."); in testAppendReplacement()
42 m = pat.matcher("one-cat-two-cats-in-the-yard"); in testAppendReplacement()
67 Matcher mat = pat.matcher(testString1); in test_resetLjava_lang_String()
78 Matcher m = p.matcher("one-cat-two-cats-in-the-yard"); in testAppendTail()
87 m = p.matcher("one-cat-two-cats-in-the-yard"); in testAppendTail()
97 m = p.matcher("one-cat-two-cats-in-the-yard"); in testAppendTail()
115 Matcher mat = pat.matcher(testString); in test_reset()
126 Matcher mat = pat.matcher(testString); in test_hasAnchoringBounds()
144 Matcher mat = pat.matcher(testString); in test_hasTransparentBounds()
162 Matcher mat = pat.matcher(testString); in test_startI()
[all …]
DOldAndroidRegexTest.java28 Matcher m = p.matcher("bcd"); in testMatches()
33 m = p.matcher("abcdefg"); in testMatches()
37 m = p.matcher("bcdefg"); in testMatches()
41 m = p.matcher("abcd"); in testMatches()
46 m = p.matcher("abc"); in testMatches()
52 m = p.matcher("abc"); in testMatches()
89 Matcher m = p.matcher("1 (919) 555-1212"); in testGroupCount()
97 Matcher m = p.matcher("abcdefg"); in testGroups()
112 Matcher m = p.matcher("abc"); in testFind()
129 Matcher m = p.matcher("fooaabfooaabfooabfoob"); in testReplaceAll()
[all …]
DMatcherTest.java46 Matcher m = Pattern.compile("a").matcher("b"); in testResults_notMatched()
52 Matcher m = Pattern.compile("a(?<g>b)c").matcher("abc"); in testAppendEvaluated()
57 m = Pattern.compile("(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)").matcher("abcdefghijk"); in testAppendEvaluated()
71 Matcher m = Pattern.compile("a(?<g>b)c").matcher("abc"); in testAppendExpandedReplacement()
79 m = Pattern.compile("(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)").matcher("abcdefghijk"); in testAppendExpandedReplacement()
94 Matcher m = Pattern.compile("a(?<g>b)c").matcher("abc"); in testAppendReplacement()
102 m = Pattern.compile("(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)").matcher("abcdefghijk"); in testAppendReplacement()
/libcore/ojluni/src/main/java/java/util/
DScanner.java320 private Matcher matcher; field in Scanner
546 matcher = delimPattern.matcher(buf); in Scanner()
547 matcher.useTransparentBounds(true); in Scanner()
548 matcher.useAnchoringBounds(false); in Scanner()
847 hasNextResult = matcher.group(); in cacheResult()
848 hasNextPosition = matcher.end(); in cacheResult()
849 hasNextPattern = matcher.pattern(); in cacheResult()
854 hasNextPosition = matcher.end(); in cacheResult()
855 hasNextPattern = matcher.pattern(); in cacheResult()
909 matcher.reset(buf); in readInput()
[all …]
/libcore/ojluni/src/main/java/sun/security/util/
DDebug.java286 Matcher matcher = pattern.matcher(source); in marshal() local
288 while (matcher.find()) { in marshal()
289 String matched = matcher.group(); in marshal()
294 matcher.appendReplacement(left, ""); in marshal()
296 matcher.appendTail(left); in marshal()
310 matcher = pattern.matcher(source); in marshal()
312 while (matcher.find()) { in marshal()
313 String matched = matcher.group(); in marshal()
318 matcher.appendReplacement(left, ""); in marshal()
320 matcher.appendTail(left); in marshal()
DDisabledAlgorithmConstraints.java279 Matcher matcher = keySizePattern.matcher(entry); in Constraints() local
280 if (matcher.matches()) { in Constraints()
286 KeySizeConstraint.Operator.of(matcher.group(1)), in Constraints()
287 Integer.parseInt(matcher.group(2))); in Constraints()
/libcore/ojluni/src/main/java/java/util/regex/
DPattern.java979 public Matcher matcher(CharSequence input) { in matcher() method in Pattern
1032 Matcher m = p.matcher(input); in matches()
1128 Matcher m = matcher(input); in split()
5654 return s -> matcher(s).find(); in asPredicate()
5674 return s -> matcher(s).matches(); in asMatchPredicate()
5711 private Matcher matcher; in splitAsStream() field in Pattern.MatcherIterator
5735 if (matcher == null) { in splitAsStream()
5736 matcher = matcher(input); in splitAsStream()
5759 while (matcher.find()) { in splitAsStream()
5760 nextElement = input.subSequence(current, matcher.start()).toString(); in splitAsStream()
[all …]
/libcore/benchmarks/src/benchmarks/regression/
DSchemePrefixBenchmark.java60 Matcher matcher = pattern.matcher(spec); in REGEX() local
61 if (matcher.find()) { in REGEX()
62 return matcher.group(1).toLowerCase(Locale.US); in REGEX()
/libcore/ojluni/src/main/java/java/time/
DPeriod.java322 Matcher matcher = PATTERN.matcher(text); in parse() local
323 if (matcher.matches()) { in parse()
324 int negate = (charMatch(text, matcher.start(1), matcher.end(1), '-') ? -1 : 1); in parse()
325 int yearStart = matcher.start(2), yearEnd = matcher.end(2); in parse()
326 int monthStart = matcher.start(3), monthEnd = matcher.end(3); in parse()
327 int weekStart = matcher.start(4), weekEnd = matcher.end(4); in parse()
328 int dayStart = matcher.start(5), dayEnd = matcher.end(5); in parse()
DDuration.java385 Matcher matcher = PATTERN.matcher(text); in parse() local
386 if (matcher.matches()) { in parse()
388 if ("T".equals(matcher.group(3)) == false) { in parse()
389 boolean negate = "-".equals(matcher.group(1)); in parse()
390 String dayMatch = matcher.group(2); in parse()
391 String hourMatch = matcher.group(4); in parse()
392 String minuteMatch = matcher.group(5); in parse()
393 String secondMatch = matcher.group(6); in parse()
394 String fractionMatch = matcher.group(7); in parse()
/libcore/ojluni/src/tools/build/tools/spp/
DSpp.java117 final Matcher ifkey = Pattern.compile("^#if\\[(!)?" + KEY + "\\]").matcher("");
118 final Matcher elsekey = Pattern.compile("^#else\\[(!)?" + KEY + "\\]").matcher("");
119 final Matcher endkey = Pattern.compile("^#end\\[(!)?" + KEY + "\\]").matcher("");
120 …pile("\\{#if\\[(!)?" + KEY + "\\]\\?" + TEXT + "(:"+ TEXT + ")?\\}|\\$" + VAR + "\\$").matcher("");
121 final Matcher vardef2 = Pattern.compile("\\$" + VAR + "\\$").matcher("");
/libcore/ojluni/src/main/java/javax/net/ssl/
DSSLParameters.java395 for (SNIMatcher matcher : matchers) { in setSNIMatchers()
396 if (sniMatchers.put(matcher.getType(), in setSNIMatchers()
397 matcher) != null) { in setSNIMatchers()
400 matcher.getType()); in setSNIMatchers()
DSNIHostName.java387 if (pattern.matcher(asciiName).matches()) { in matches()
393 return pattern.matcher(IDN.toUnicode(asciiName)).matches(); in matches()
/libcore/tools/upstream/src/main/java/libcore/
DCompareUpstreams.java97 Matcher matcher = pattern.matcher(line); in androidChangedComments() local
98 if (matcher.find()) { in androidChangedComments()
99 String type = matcher.group(1); in androidChangedComments()
103 String match = matcher.group(2); in androidChangedComments()
DRepository.java281 Matcher matcher = pattern.matcher(line); in loadOrderedRelPathsSetFromBlueprint() local
282 while (matcher.find()) { in loadOrderedRelPathsSetFromBlueprint()
283 Path relPath = Paths.get(matcher.group(1)); in loadOrderedRelPathsSetFromBlueprint()
/libcore/metrictests/memory/apps/src/libcore/heapdumper/
DActions.java75 Matcher m = p.matcher(sequence); in run()

12