I have strings with version numbers like:
"1.4.2.57"
"8.4.3"
"3.12.0.25"
I only need the first 3 numbers, I was going to use substr, but if the numbers are > 9 the substr will fail.
How can I extract x.x.x from strings like (x.x - x.x.x - x.x.x.x) where x is = [0-99]
^(\d+)\D+(\d+)\D+(\d+)should do it, you'll have to translate that to javascript regex though. You'll have the first 3 digits with any delimiters in your first three capture groups, you can change \D+ to (?:\s|-|\.)+ if you want to specify .,-, and space as your only valid delimiters with none capturing groups.