Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
(?<=")[^"]+?(?="(?:\s*?,|\s*?$))|(?<=(?:^|,)\s*?)(?:[^,"\s][^,"]*[^,"\s])|(?:[^,"\s])(?![^"]*?"(?:\s*?,|\s*?$))(?=\s*?(?:,|$))
/
gm
Input 1
1
New
it, finds, values, in, comma, separated, lists (it also matches new lines and any whitespace, hence the end-of-line highlight) it, "handles double quotes" it, "handles, double, quotes, with, commas, in, them" it, ignores, trailing whitespaces " unless it's in quotes " ,,,,,and,,,,,handles-??-weird.stuff,,,,,,?????
Extraction