17 #ifndef LLVM_SUPPORT_REGEX_H
18 #define LLVM_SUPPORT_REGEX_H
26 template<
typename T>
class SmallVectorImpl;
90 std::string *
Error =
nullptr);
105 #endif // LLVM_SUPPORT_REGEX_H
static std::string escape(StringRef String)
Turn String into a regex by escaping its special characters.
By default, the POSIX extended regular expression (ERE) syntax is assumed.
bool isValid(std::string &Error)
isValid - returns the error encountered during regex compilation, or matching, if any...
static std::error_code error(DiagnosticHandlerFunction DiagnosticHandler, std::error_code EC, const Twine &Message)
Compile for newline-sensitive matching.
static bool isLiteralERE(StringRef Str)
If this function returns true, ^Str$ is an extended regular expression that matches Str and only Str...
std::string sub(StringRef Repl, StringRef String, std::string *Error=nullptr)
sub - Return the result of replacing the first match of the regex in String with the Repl string...
unsigned getNumMatches() const
getNumMatches - In a valid regex, return the number of parenthesized matches it contains.
Regex & operator=(Regex regex)
Regex(StringRef Regex, unsigned Flags=NoFlags)
Compiles the given regular expression Regex.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
Compile for matching that ignores upper/lower case distinctions.
bool match(StringRef String, SmallVectorImpl< StringRef > *Matches=nullptr)
matches - Match the regex against a given String.
StringRef - Represent a constant reference to a string, i.e.