I am trying to parse lines of text to extract 4 version numbers:
v.1.7.600.0 - latest | 9.2.6200.0 to 9.2.9999
I am looking for the ability to parse a string like this:
['v.1.7.600.0', 'latest', '9.2.6200.0', '9.2.9999']
At the moment, I have something like this:
var line = "v.1.7.600.0 - latest | 9.2.6200.0 to 9.2.9999"
var result = line.split(/ (\||-|to) /g)
console.log(result)
Run codeHide resultI'm not so good at regex, but it matches, so I'm not sure why it includes them in the result.
Shard source
share