I have the following line:
1 2/5 0.4 1+3i
Each group can be separated by one or more spaces. The first one, can have spaces or not before him. The last one can have spaces or not after him.
I want to get:
1
2/5
0.4
1+3i
How can I get them with regex? To be simple I tried on a shorter example because complex is the more difficult:
2 3i
I tried with the following regex:
/\s*((?:[\d]+)|(?:[\d]*\i))/g
But I get the i
separated from its integer:
2
3
i
I can't find a good regex for my problem. Any solution?