diff --git a/include/mesytec-mnode/mnode_string.hpp b/include/mesytec-mnode/mnode_string.hpp new file mode 100644 index 0000000..31af9dd --- /dev/null +++ b/include/mesytec-mnode/mnode_string.hpp @@ -0,0 +1,19 @@ +#ifndef E7FD4517_4FF5_4BDA_9AE4_95308A37554D +#define E7FD4517_4FF5_4BDA_9AE4_95308A37554D + +#include +#include + +namespace mesytec::mnode +{ + +template +void split_string(const std::string &str, const std::regex &re, OutputIt out) +{ + std::sregex_token_iterator it(str.begin(), str.end(), re, -1); + std::copy(it, std::sregex_token_iterator(), out); +} + +} // namespace mesytec::mnode + +#endif /* E7FD4517_4FF5_4BDA_9AE4_95308A37554D */