123456789101112131415161718192021222324252627282930313233343536373839 |
- #ifndef LS_STD_REGEX_UTILS_HPP
- #define LS_STD_REGEX_UTILS_HPP
- #include <string>
- #include <regex>
- namespace ls
- {
- namespace std
- {
- namespace core
- {
- class RegexUtils
- {
- public:
- RegexUtils() = default;
- ~RegexUtils() = default;
- static ::std::string escapeString(const ::std::string &_text)
- {
- static ::std::regex regexMetaEscape(R"(([\^\$\\\.\*\+\?\(\)\[\]\{\}\|]))");
- return ::std::regex_replace(_text, regexMetaEscape, R"(\$1)");
- }
- };
- }
- }
- }
- #endif
|