16 llvm::Regex::RegexFlags flags)
17 : m_regex_text(std::string(str)),
19 m_regex(
llvm::Regex(str, flags)) {}
29 return m_regex.match(str, matches);
39 return llvm::make_error<llvm::StringError>(
error,
40 llvm::inconvertibleErrorCode());
41 return llvm::Error::success();
static llvm::raw_ostream & error(Stream &strm)
std::string m_regex_text
A copy of the original regular expression text.
bool IsValid() const
Test if this object contains a valid regular expression.
bool Execute(llvm::StringRef string, llvm::SmallVectorImpl< llvm::StringRef > *matches=nullptr) const
Execute a regular expression match using the compiled regular expression that is already in this obje...
llvm::Error GetError() const
Return an error if the regular expression failed to compile.
llvm::Regex m_regex
The compiled regular expression.
llvm::StringRef GetText() const
Access the regular expression text.
RegularExpression()=default
The default constructor that initializes the object state such that it contains no compiled regular e...
A class that represents a running process on the host machine.