58 set(pattern, ignoreCase);
64 const std::string& pattern,
71 set(pattern, ignoreCase);
99 return (ctrl_ == ctrlType::NEGATED);
105 bool old(ctrl_ == ctrlType::NEGATED);
111 ctrl_ = ctrlType::NEGATED;
116 ctrl_ = ctrlType::NORMAL;
125 return (preg_ && ctrl_ == ctrlType::NORMAL) ? preg_->re_nsub : 0;
135 (pattern ? std::char_traits<char>::length(pattern) : 0),
158 else if (text.empty())
160 return (ctrl_ == ctrlType::NEGATED);
163 return std::string::npos != find(text);
172 std::swap(preg_, rgx.preg_);
173 std::swap(ctrl_, rgx.ctrl_);
Ostream & operator()() const
Output stream (master only).
void negate()
Inplace negate.
Wrapper around POSIX extended regular expressions with some additional prefix-handling....
void operator=(const regExpPosix &)=delete
Copy assignment - disallowed.
void swap(regExpPosix &rgx)
Swap contents.
bool empty() const noexcept
Return true if a precompiled expression does not exist.
bool set(const char *pattern, bool ignoreCase=false)
Compile pattern into a regular expression, optionally ignore case.
bool exists() const noexcept
Return true if a precompiled expression exists.
bool search(const std::string &text) const
Return true if the regex was found within the text.
bool negated() const noexcept
True if pattern matching is negated.
regExpPosix() noexcept
Default construct.
~regExpPosix()
Destructor.
bool set() const
Are all the vector set.