C++ (Qt)QString s("DATA.VALUE, SIZE, \",\", REP");QStringList strings = s.split(", ");
QString s("DATA.VALUE, SIZE, \",\", REP");QStringList strings = s.split(",", QString::SkipEmptyParts);foreach(QString string, strings) { string.trimmed();}
Python>>> import re>>> fld_re = re.compile(r'\s*((?:[^,"]|"[^"]*")*)\s*(?:,|$)')>>> fld_re.findall('DATA.VALUE, SIZE, ",", "", REP')['DATA.VALUE', 'SIZE', '","', '""', 'REP', '']
C++ (Qt)QString s("DATA.VALUE, SIZE, \",\", REP");QStringList strings = s.split(QRegExp(",\\s*"), QString::SkipEmptyParts);
>>> import re>>> fld_re = re.compile(r'(?:^|,)\s*((?:[^,"]|"[^"]*")*)\s*(?=,|$)')>>> fld_re.findall('DATA.VALUE, SIZE, ",", "", "\n", REP,')['DATA.VALUE', 'SIZE', '","', '""', '"\n"', 'REP', '']