LLVM: include/llvm/Support/Regex.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16#ifndef LLVM_SUPPORT_REGEX_H
17#define LLVM_SUPPORT_REGEX_H
18
21#include
22
24
25namespace llvm {
28
30 public:
33
35
36
37
38
39
41
42
43
45
47 };
48
50
51
52
53
64
65
66
68 bool isValid() const { return !error; }
69
70
71
72
74
75
76
77
78
79
80
81
82
83
84
87 std::string *Error = nullptr) const;
88
89
90
91
92
93
94
95
96
97
98
99
101 std::string *Error = nullptr) const;
102
103
104
106
107
109
110 private:
113 };
114}
115
116#endif
Lightweight error class with error context and mandatory checking.
Regex(const Regex &)=delete
RegexFlags
Definition Regex.h:31
@ Newline
Compile for newline-sensitive matching.
Definition Regex.h:40
@ IgnoreCase
Compile for matching that ignores upper/lower case distinctions.
Definition Regex.h:34
@ NoFlags
Definition Regex.h:32
@ BasicRegex
By default, the POSIX extended regular expression (ERE) syntax is assumed.
Definition Regex.h:44
static LLVM_ABI std::string escape(StringRef String)
Turn String into a regex by escaping its special characters.
Regex & operator=(Regex regex)
Definition Regex.h:57
bool isValid() const
Definition Regex.h:68
LLVM_ABI std::string sub(StringRef Repl, StringRef String, std::string *Error=nullptr) const
sub - Return the result of replacing the first match of the regex in String with the Repl string.
static LLVM_ABI bool isLiteralERE(StringRef Str)
If this function returns true, ^Str$ is an extended regular expression that matches Str and only Str.
LLVM_ABI unsigned getNumMatches() const
getNumMatches - In a valid regex, return the number of parenthesized matches it contains.
LLVM_ABI bool match(StringRef String, SmallVectorImpl< StringRef > *Matches=nullptr, std::string *Error=nullptr) const
matches - Match the regex against a given String.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
StringRef - Represent a constant reference to a string, i.e.
This is an optimization pass for GlobalISel generic memory operations.
@ LLVM_MARK_AS_BITMASK_ENUM
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.