split string but ignore sep inside double quotes
andrea.crotti.0 at gmail.com
Wed Apr 13 12:24:35 EDT 2011
Andrea Crotti <andrea.crotti.0 at gmail.com> writes:
> I'm not sure how but also this seems to work:
> In: s = '2,"some, text",more text'
> In : re.split(r'(?<=">),', s)
> Out: ['2,"some, text",more text']
> I just wanted to try the lookahead functions, which I never use but
> sometimes might come handy.
Eh eh no sorry I misread the output, it's a list with one element in
So anyway I suppose you can look ahead or before if there is a " and
don't match the "," in this case, that was the main idea.
More information about the Python-list