Here's how I decided to solve it:
('(?>\\.|.)*?'|[^\,]+)
Regex101
Explanation:
( Start capture group
' Match an apostrophe
(?> Atomically match the following
\\. Match \ literally and then any single character
|. Or match just any single character
) Close atomic group
*?' Match previous group 0 or more times until the first '
|[^\,] OR match any character that is not a comma (,)
+ Match the previous regex [^\,] one or more times
) Close capture group
, :
, 'a \' b'
(?>\\.|.) :
, \' \, ', / , .
, , : ('(?>\\\\.|.)*?'|[^\\,]+)
10 regex , . , , . ? /? ~ ..
, .
:
"This is on one line.\nThis is on another line."
\n :
"This is on one line.
This is on another line."
. , , . :
"[^\n]*"
\n :
"[^
]*"
, , , . , , . , , \n - ( escape-: \r, \t, \\ ..). escape- \n escape-, \\, n. .
"[^\\n]*"
, , :
"[^\n]*"
, \\ - escape-, " \\ \". \\ , - n , , escape-.
, 4 ? :
(?>\\.|.)
, , . . (\\.) " , , , ". , .
\\ \\ .
, :
(?>\\\\.|.)