BiteTheDDDDt commented on code in PR #57643:
URL: https://github.com/apache/doris/pull/57643#discussion_r2493192892
##########
be/src/vec/functions/function_regexp.cpp:
##########
@@ -51,6 +52,136 @@
namespace doris::vectorized {
#include "common/compile_check_begin.h"
+
+// Helper structure to hold either RE2 or Boost.Regex
+struct RegexpExtractEngine {
+ std::unique_ptr<re2::RE2> re2_regex;
+ std::unique_ptr<boost::regex> boost_regex;
+
+ bool is_boost() const { return boost_regex != nullptr; }
+ bool is_re2() const { return re2_regex != nullptr; }
+
+ // Try to compile with RE2 first, fallback to Boost.Regex if RE2 fails
+ static bool compile(const StringRef& pattern, std::string* error_str,
+ RegexpExtractEngine& engine, bool
enable_extended_regex) {
+ engine.re2_regex =
std::make_unique<re2::RE2>(re2::StringPiece(pattern.data, pattern.size));
+ if (engine.re2_regex->ok()) {
+ return true;
+ } else if (!enable_extended_regex) {
+ *error_str =
Review Comment:
maybe we can add some hit msg to tell user to set enable_extended_regex
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]