having a string similar to the following I would like to get the value (test1, test2) after the string -option (or wathever):
command --option test1 other stuff --option test2 other stuff
I tried with as following
const regex = /--option ([^\w\s]) /g
regex.exec(string)
the problem is that I get just the first occurance and if there is more than 1 space it doesn't get the value