Lines Matching full:regex
26 #include <regex.h>
31 namespace regex {
41 // Implements regex parsing and regex search based on C library `regex.h`.
43 class Regex {
46 ~Regex() { in ~Regex()
51 Regex(Regex&) = delete;
52 Regex(Regex&& other) { in Regex() function
56 Regex& operator=(Regex&& other) {
57 this->~Regex();
58 new (this) Regex(std::move(other));
61 Regex& operator=(const Regex&) = delete;
64 // Parse regex pattern. Returns error if regex pattern is invalid.
65 static base::StatusOr<Regex> Create(const char* pattern) { in Create()
67 regex_t regex; in Create() local
68 if (regcomp(®ex, pattern, 0)) { in Create()
69 return base::ErrStatus("Regex pattern '%s' is malformed.", pattern); in Create()
71 return Regex(std::move(regex)); in Create()
74 PERFETTO_FATAL("Windows regex is not supported."); in Create()
78 // Returns true if string matches the regex.
85 PERFETTO_FATAL("Windows regex is not supported."); in Search()
91 explicit Regex(regex_t regex) : regex_(std::move(regex)) {} in Regex() argument
96 } // namespace regex