I have a string that looks something like:
" 'a 'b '(d f g (1 2)) '(3 4) (a d) d "
And what I am trying to do is match so I get this output:
'a, 'b, '(d f g (1 2)), '(3 4), (a d), d
I am currently using:
"'\(.*\)|\(\.*\)|'\w+|\w+"
But there is a problem i've runned into using this, for example if I write
'(a b c) (d f)
it will return
'(a b c) (d f)
instead of
'(a b c), (d f)
So my question is if there is a way to solve this with regex or do I have to solve this an other way?