 <p>Assuming <code>(</code> and <code>)</code> are not nested and unescaped. You can use split using:</p> <pre><code>String[] arr = input.split(",(?![^()]*\\))\\s*"); </code></pre> <p><a href="https://regex101.com/r/wK4bC6/1" rel="nofollow">RegEx Demo</a></p> <p><code>,(?![^()]*\))</code> will match a comma if it is NOT followed by a non-parentheses text and <code>)</code>, thus ignoring commas inside <code>(</code> and <code>)</code>.</p>