Lines Matching refs:pattern
20 * A simple pattern matcher, which is safe to use on untrusted data: it does
26 * Pattern type: the given pattern must exactly match the string it is
32 * Pattern type: the given pattern must match the
38 * Pattern type: the given pattern is interpreted with a
51 public PatternMatcher(String pattern, int type) {
52 mPattern = pattern;
109 static boolean matchPattern(String pattern, String match, int type) {
112 return pattern.equals(match);
114 return match.startsWith(pattern);
119 final int NP = pattern.length();
125 char nextChar = pattern.charAt(0);
129 nextChar = ip < NP ? pattern.charAt(ip) : 0;
134 nextChar = ip < NP ? pattern.charAt(ip) : 0;
139 // at the end with a pattern match, so
144 nextChar = pattern.charAt(ip);
146 // pattern is found.
149 nextChar = ip < NP ? pattern.charAt(ip) : 0;
158 // Whoops, the next character in the pattern didn't
163 nextChar = ip < NP ? pattern.charAt(ip) : 0;
174 nextChar = ip < NP ? pattern.charAt(ip) : 0;
188 // have a '.*' at the end of the pattern, which should still count
190 if (ip == NP-2 && pattern.charAt(ip) == '.'
191 && pattern.charAt(ip+1) == '*') {