If we're only interested in the major version, how about a regex for "0.(x)" or "(x).y" and then simply always return matching group 1?