Lines Matching refs:str
127 // Returns true iff regular expression re matches the entire str.
128 bool RE::FullMatch(const char* str, const RE& re) {
132 return regexec(&re.full_regex_, str, 1, &match, 0) == 0;
135 // Returns true iff regular expression re matches a substring of str
136 // (including str itself).
137 bool RE::PartialMatch(const char* str, const RE& re) {
141 return regexec(&re.partial_regex_, str, 1, &match, 0) == 0;
176 // Returns true iff ch appears anywhere in str (excluding the
178 bool IsInSet(char ch, const char* str) {
179 return ch != '\0' && strchr(str, ch) != NULL;
291 // or +). The behavior is undefined if str contains too many
297 const char* str) {
305 // We know that the atom matches each of the first i characters in str.
306 if (i >= min_count && MatchRegexAtHead(regex, str + i)) {
308 // Since we only care about *whether* the pattern matches str
313 if (str[i] == '\0' || !AtomMatchesChar(escaped, c, str[i]))
319 // Returns true iff regex matches a prefix of str. regex must be a
322 bool MatchRegexAtHead(const char* regex, const char* str) {
329 return *str == '\0';
340 escaped, regex[0], regex[1], regex + 2, str);
344 // character of str and recurse.
345 return (*str != '\0') && AtomMatchesChar(escaped, *regex, *str) &&
346 MatchRegexAtHead(regex + 1, str + 1);
350 // Returns true iff regex matches any substring of str. regex must be
358 bool MatchRegexAnywhere(const char* regex, const char* str) {
359 if (regex == NULL || str == NULL)
363 return MatchRegexAtHead(regex + 1, str);
365 // A successful match can be anywhere in str.
367 if (MatchRegexAtHead(regex, str))
369 } while (*str++ != '\0');
380 // Returns true iff regular expression re matches the entire str.
381 bool RE::FullMatch(const char* str, const RE& re) {
382 return re.is_valid_ && MatchRegexAnywhere(re.full_pattern_, str);
385 // Returns true iff regular expression re matches a substring of str
386 // (including str itself).
387 bool RE::PartialMatch(const char* str, const RE& re) {
388 return re.is_valid_ && MatchRegexAnywhere(re.pattern_, str);
662 // Parses 'str' for a 32-bit signed integer. If successful, writes
665 bool ParseInt32(const Message& src_text, const char* str, Int32* value) {
668 const long long_value = strtol(str, &end, 10); // NOLINT
676 << " has value \"" << str << "\".\n";
693 << " has value " << str << ", which overflows.\n";