I need to separate a string like this:
cat, dog , ant( elephant, lion(tiger)), bird
into this:
cat
dog
ant( elephant, lion(tiger))
bird
My current state is this: (\w+)(,\s*)*
, but that also separates elephant, lion and tiger. Further, some commas and spaces are kept.
You might have guessed, that I will call the same expression again on the ant(...)
string in a further iteration. If important, I'll use this in c++.