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
/
# Only include if previous char was start of string or delimiter (?<=^|,) (?: # 1st option: empty quoted string (,'',) '{2} | # 2nd option: nothing (,,) (?:) | # 3rd option: all but quoted strings (,123,) # (included linebreaks to allow multiline matching) [^,'\r\n]+ | # 4th option: quoted strings (,'123''321',) # start pling ' (?: # double quote '{2} | # or anything but quotes [^']+ # at least one occurance - greedy )+ # end pling ' ) # Only include if next char is delimiter or end of string (?=,|$)
/
gxm
Unit Tests
There are no unit tests, click
here
to add some.