C++ spliting string by delimiters and keeping the delimiters in result
问题 I'm looking for a way to split string by multiple delimiters using regex in C++ but without losing the delimiters in output, keeping the delimiters with splitted parts in order, for example: Input aaa,bbb.ccc,ddd-eee; Output aaa , bbb . ccc , ddd - eee ; I've found some solutions for this but all in C# or java, looking for some C++ solution, preferably without using Boost. 回答1: You could build your solution on top of the example for regex_iterator. If, for example, you know your delimiters