Lines Matching defs:String
83 bool Regex::match(StringRef String, SmallVectorImpl<StringRef> *Matches,
96 if (String.data() == nullptr)
97 String = "";
103 pm[0].rm_eo = String.size();
105 int rc = llvm_regexec(preg, String.data(), nmatch, pm.data(), REG_STARTEND);
129 Matches->push_back(StringRef(String.data()+pm[i].rm_so,
137 std::string Regex::sub(StringRef Repl, StringRef String,
142 if (!match(String, &Matches, Error))
143 return std::string(String);
147 std::string Res(String.begin(), Matches[0].begin());
224 Res += StringRef(Matches[0].end(), String.end() - Matches[0].end());
239 std::string Regex::escape(StringRef String) {
241 for (char C : String) {