diff options
-rw-r--r-- | src/lib/utils/socket/uri.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/utils/socket/uri.cpp b/src/lib/utils/socket/uri.cpp index ea7188b31..f8506d0e7 100644 --- a/src/lib/utils/socket/uri.cpp +++ b/src/lib/utils/socket/uri.cpp @@ -26,13 +26,15 @@ constexpr bool isdigit(char ch) bool isDomain(const std::string& domain) { -#if defined(__GLIBCXX__) && (__GLIBCXX__ < 20160726) //GCC 4.8 does not support regex +#if defined(__GLIBCXX__) && (__GLIBCXX__ < 20160726) + // GCC 4.8 does not support regex return true; -#endif +#else std::regex re( R"(^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$)"); std::cmatch m; return std::regex_match(domain.c_str(), m, re); +#endif } bool isIPv4(const std::string& ip) |