adamdebreceni commented on code in PR #1387:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1387#discussion_r966924253
##########
libminifi/src/utils/RegexUtils.cpp:
##########
@@ -22,58 +22,86 @@
#include <vector>
#include "Exception.h"
+#include <regex.h>
Review Comment:
removed
##########
libminifi/include/utils/RegexUtils.h:
##########
@@ -150,18 +132,32 @@ class Regex {
int regex_mode_;
#endif
- friend bool regexMatch(const std::string &string, const Regex& regex);
- friend bool regexMatch(const std::string &string, SMatch& match, const
Regex& regex);
- friend bool regexSearch(const std::string &string, const Regex& regex);
- friend bool regexSearch(const std::string &string, SMatch& match, const
Regex& regex);
+ friend bool regexMatch(const char* str, CMatch& match, const Regex& regex);
+ friend bool regexSearch(const char* str, CMatch& match, const Regex& regex);
+
+ friend bool regexMatch(const std::string_view& str, SVMatch& match, const
Regex& regex);
+ friend bool regexSearch(const std::string_view& str, SVMatch& match, const
Regex& regex);
+
+ friend bool regexMatch(const std::string& str, SMatch& match, const Regex&
regex);
+ friend bool regexSearch(const std::string& str, SMatch& match, const Regex&
regex);
+
friend SMatch getLastRegexMatch(const std::string& string, const
utils::Regex& regex);
};
-bool regexMatch(const std::string &string, const Regex& regex);
-bool regexMatch(const std::string &string, SMatch& match, const Regex& regex);
+bool regexMatch(const char* str, const Regex& regex);
+bool regexMatch(const char* str, CMatch& match, const Regex& regex);
+bool regexSearch(const char* str, const Regex& regex);
+bool regexSearch(const char* str, CMatch& match, const Regex& regex);
+
+bool regexMatch(const std::string_view& str, const Regex& regex);
+bool regexMatch(const std::string_view& str, SVMatch& match, const Regex&
regex);
+bool regexSearch(const std::string_view& str, const Regex& regex);
+bool regexSearch(const std::string_view& str, SVMatch& match, const Regex&
regex);
Review Comment:
added tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]