Fix bug in reading a version number from a string

It only accepted single digits, which means '0.*.9' and '09.1' both match for 0.9.1 and nothing will match for 0.10.*.