Presuming I have the following string:
This is a very random string which contains the version number 3.2.1 and I’m looking to extract just the version number. This is a second version number that I don’t want to extract: 5.7.8, and just for kicks, this is a third version number 9.0.1
Would it be possible to extract just the first version number, i.e 3.2.1
using one regex? I’m using JavaScript and although I’ve been able to extract it using two separate regex’s by searching for two strings that surround the version number, then searching in between them for a version number, I haven’t found out how to merge them into one.
Important to note, the string contains lots of version numbers, which come before and after the one I want for extract. However the version number I’m looking to extract always sits between the words number
and looking
.
Any help is much appreciated.
Thank you