#include <algorithm>
#include <iostream>
#include <iterator>
#include <regex>
#include <string>
#include <vector>
using namespace std;
int main() {
const auto input = "please split,this,csv, ,line,\\,\n"s;
const regex re{ "((?:[^\\\\,]|\\\\.)+)(?:,|$)" };
const vector<string> m_vecFields{ sregex_token_iterator(cbegin(input), cend(input), re, 1), sregex_token_iterator() };
cout << input << endl;
copy(cbegin(m_vecFields), cend(m_vecFields), ostream_iterator<string>(cout, "\n"));
}
I2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aXRlcmF0b3I+CiNpbmNsdWRlIDxyZWdleD4KI2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPHZlY3Rvcj4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCWNvbnN0IGF1dG8gaW5wdXQgPSAicGxlYXNlIHNwbGl0LHRoaXMsY3N2LCAsbGluZSxcXCxcbiJzOwoJY29uc3QgcmVnZXggcmV7ICIoKD86W15cXFxcLF18XFxcXC4pKykoPzosfCQpIiB9OwoJY29uc3QgdmVjdG9yPHN0cmluZz4gbV92ZWNGaWVsZHN7IHNyZWdleF90b2tlbl9pdGVyYXRvcihjYmVnaW4oaW5wdXQpLCBjZW5kKGlucHV0KSwgcmUsIDEpLCBzcmVnZXhfdG9rZW5faXRlcmF0b3IoKSB9OwoKCWNvdXQgPDwgaW5wdXQgPDwgZW5kbDsKCgljb3B5KGNiZWdpbihtX3ZlY0ZpZWxkcyksIGNlbmQobV92ZWNGaWVsZHMpLCBvc3RyZWFtX2l0ZXJhdG9yPHN0cmluZz4oY291dCwgIlxuIikpOwp9