I need a help with regular expressions in JavaScript (Sorry, I’m still trying to learn it.).
I have the string: value1 value2 (value3 value4) -value5 value6
(Can have infinite values in each of three parts.)
And I need to separate:
var1 = value1 + ' ' + value2 ...
var2 = value3 + ' ' + value4 ...
var3 = value5 + ' ' + value6 ...
Can you help me with this? Thanks!
Splitting may be an idea, if the formatting of the string stays like the given format: