/
^ # Start of version string
\s* # Ignore leading whitespace
(?:v\.?)? # Optional "v" or "v." before the version
(?<major>\d+) \. (?<minor>\d+) \. (?<patch>\d+) # MAJOR.MINOR.PATCH
(?:- # Pre-release versions start with '-'
(?<pre> # Capture the pre-release identifier(s)
(?: # The PR rules are annoyingly tight
[0-9A-Za-z-] # No leading `0`,