MCPcopy Create free account
hub / github.com/ByConity/ByConity / getCompiledRegex

Function getCompiledRegex

src/Server/HTTPHandler.cpp:1135–1146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1133}
1134
1135static inline CompiledRegexPtr getCompiledRegex(const std::string & expression)
1136{
1137 auto compiled_regex = std::make_shared<const re2::RE2>(expression);
1138
1139 if (!compiled_regex->ok())
1140 throw Exception(
1141 "Cannot compile re2: " + expression + " for http handling rule, error: " + compiled_regex->error()
1142 + ". Look at https://github.com/google/re2/wiki/Syntax for reference.",
1143 ErrorCodes::CANNOT_COMPILE_REGEXP);
1144
1145 return compiled_regex;
1146}
1147
1148HTTPRequestHandlerFactoryPtr createPredefinedHandlerFactory(IServer & server, const std::string & config_prefix)
1149{

Callers 1

Calls 3

ExceptionClass · 0.50
okMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected