diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-03-23 18:50:55 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-03-26 18:13:32 +0300 |
commit | 95c579df686f115c0fd3697f2723fa73476c4584 (patch) | |
tree | 5d76adbcf75692d278b4085c6e996ab58a3e4e25 /libbutl/regex.ixx | |
parent | 5ecdb9a3b5cb85418f69126226b2636caed2e4da (diff) |
Add regex_replace_parse() overloads
Diffstat (limited to 'libbutl/regex.ixx')
-rw-r--r-- | libbutl/regex.ixx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libbutl/regex.ixx b/libbutl/regex.ixx index dec15d1..805acd1 100644 --- a/libbutl/regex.ixx +++ b/libbutl/regex.ixx @@ -21,4 +21,21 @@ LIBBUTL_MODEXPORT namespace butl //@@ MOD Clang needs this for some reason. return make_pair (move (r), match); } + + template <typename C> + inline std::pair<std::basic_regex<C>, std::basic_string<C>> + regex_replace_parse (const std::basic_string<C>& s, + std::regex_constants::syntax_option_type f) + { + return regex_replace_parse (s.c_str (), s.size (), f); + } + + template <typename C> + inline std::pair<std::basic_regex<C>, std::basic_string<C>> + regex_replace_parse (const C* s, + std::regex_constants::syntax_option_type f) + { + return regex_replace_parse ( + s, std::basic_string<C>::traits_type::length (s), f); + } } |