I\'ve got a string like
s=\"abc, 3rncd (23uh, sdfuh), 32h(q23q)89 (as), dwe8h, edt (1,wer,345,rtz,tr t), nope\";
and I want to split it int
Assuming ( and ) are not nested and unescaped. You can use split using:
(
)
String[] arr = input.split(",(?![^()]*\\))\\s*");
RegEx Demo
,(?![^()]*\)) will match a comma if it is NOT followed by a non-parentheses text and ), thus ignoring commas inside ( and ).
,(?![^()]*\))