This is another solution that works with replaceAll.
Raw regular expression:
((?:^\(|\G)(?: *'(?:[^'\\]|\\.)*' *,| *[^:' ][^,]* *,)* *):([^,]* *(?:,|\)$))
Quote line (used in replaceAll):
"((?:^\\(|\\G)(?: *'(?:[^'\\\\]|\\\\.)*' *,| *[^:' ][^,]* *,)* *):([^,]* *(?:,|\\)$))"
Replacement (used in replaceAll):
"$1?$2"
Input Example:
( :a , :abc, 'quoted with :colon, and comma', skdhfks'sdfkdf , :sdf, 'sdfds\'f', :sdfksdf, sdkhfksd , :dfsd, sdfk'fjsdhfkf, 'werwer', :sdf, :Sdf, skhfskjdf, 'asdads\' :asdkahsd ad' )
:
( ?a , ?abc, 'quoted with :colon, and comma', skdhfks'sdfkdf , ?sdf, 'sdfds\'f', ?sdfksdf, sdkhfksd , ?dfsd, sdfk'fjsdhfkf, 'werwer', ?sdf, ?Sdf, skhfskjdf, 'asdads\' :asdkahsd ad' )
, , . ' , . ' - \. , . (:a, , :b).
DEMO
, .
. (), .
(?:^\(|\G)(?: *'(?:[^'\\]|\\.)*' *,| *[^:' ][^,]* *,)* *:[^,]* *(?:,|\)$)
( , , ):
(?:^\(|\G)
(?:
*'(?:[^'\\]|\\.)*' *,
|
*[^:' ][^,]* *,
)*
*:[^,]* *
(?:,|\)$)
: , , , .
(?:^\(|\G), ( \G.
, , - '(?:[^'\\]|\\.)*', [^:' ][^,]*, ' : ,. \\., \, . *.
, *, , .
: :[^,]*.
(?:,|\)$), , ) ,. \G.