explode(), strpos() or whatever elese
Best How To :
You could use the below regex to match the version number.
\b word boundary which matches between a word character and a non-word character.
\d+ Matches one or more digits.
(?:...) Called non-capturing group.
(?:\.\d+) Matches a dot and the following one or more digits.
(?:\.\d+)* , matches a dot and the following one or more digits zero or more times.
* repeats the previous token zero or more times. If the version number must contain a dot, then change the
* in this pattern
+ repeats the previous token one or more times.
In js, it would be like