How would I use JavaScript to create a regular expression that finds all text in between comma delimiters, but ignores commas found inside nested parentheses? For example, in the example subject below, I would hope to get exactly 3 matches:
Example Subject
one, two, start (a, b) end
Expected matches:
- "one"
- "two"
- "start (a, b) end"
After spending nearly a full day trying (and failing) to figure this out, I remembered my old friend Stackoverflow. Can anyone help? Perhaps there are techniques aside from regular expressions that would be better suited for this task?