doc: Fix version switcher JS

The version parser incorrectly splits by character, which means stuff like v0.10 will be treated as v0.1, and thus the selector will never have a selection (because there is no v0.1). Additionally, the regex doesn't handle multi-digit versions, and would popup an error about the wrong domain.

Also, the default selection was determined by comparing the *path* value with the current version, instead of comparing the version value (for the selector) with the current version. Consequently, no default selection would be made, and you'd always have the latest selected (meaning you could never switch *to* the latest.)