Dev Essential
Loading...
Searching...
No Matches
regularexpression.h
Go to the documentation of this file.
1
14
15#ifndef A_UTILS_UTIL_REGEX_SOURCE_INCLUDED_
16#define A_UTILS_UTIL_REGEX_SOURCE_INCLUDED_
17
18#include <memory>
19#include <string>
20
21namespace a_util {
22namespace regex {
25public:
32
33public:
38
46 RegularExpression(const std::string& pattern, bool case_sensitive = true);
47
52
58
65
72 bool setPattern(const std::string& pattern, bool case_sensitive = true);
73
78 std::string getPattern() const;
79
84 const std::string& getError() const;
85
91 bool fullMatch(const std::string& text) const;
92
115 bool fullMatch(const std::string& text,
116 std::string& arg1,
117 std::string& arg2 = noArg(),
118 std::string& arg3 = noArg(),
119 std::string& arg4 = noArg(),
120 std::string& arg5 = noArg(),
121 std::string& arg6 = noArg(),
122 std::string& arg7 = noArg(),
123 std::string& arg8 = noArg(),
124 std::string& arg9 = noArg(),
125 std::string& arg10 = noArg(),
126 std::string& arg11 = noArg(),
127 std::string& arg12 = noArg(),
128 std::string& arg13 = noArg(),
129 std::string& arg14 = noArg(),
130 std::string& arg15 = noArg(),
131 std::string& arg16 = noArg()) const;
132
140 bool match(const std::string& text, AnchorType anchor, int& consumed) const;
141
142private: // static helpers
144 static std::string& noArg();
145
146private: // data
147 class Implementation;
148 std::unique_ptr<Implementation> _impl;
149};
150
151} // namespace regex
152} // namespace a_util
153
154#endif // A_UTILS_UTIL_REGEX_SOURCE_INCLUDED_
AnchorType
Anchor type.
Definition regularexpression.h:27
@ AT_Start
Anchor at start only.
Definition regularexpression.h:29
@ AT_Both
Anchor at start and end.
Definition regularexpression.h:30
@ AT_Unanchored
No anchoring.
Definition regularexpression.h:28
RegularExpression(const RegularExpression &other)
std::string getPattern() const
RegularExpression & operator=(const RegularExpression &other)
bool fullMatch(const std::string &text, std::string &arg1, std::string &arg2=noArg(), std::string &arg3=noArg(), std::string &arg4=noArg(), std::string &arg5=noArg(), std::string &arg6=noArg(), std::string &arg7=noArg(), std::string &arg8=noArg(), std::string &arg9=noArg(), std::string &arg10=noArg(), std::string &arg11=noArg(), std::string &arg12=noArg(), std::string &arg13=noArg(), std::string &arg14=noArg(), std::string &arg15=noArg(), std::string &arg16=noArg()) const
const std::string & getError() const
bool match(const std::string &text, AnchorType anchor, int &consumed) const
bool fullMatch(const std::string &text) const
bool setPattern(const std::string &pattern, bool case_sensitive=true)
RegularExpression(const std::string &pattern, bool case_sensitive=true)
Serves as component for regular expression functionality.
Definition regex.h:20
Serves as the root component, with common functionality documented in core functionality.
Definition base.h:24