I added some tests in 2105ab8553b7 and found no bug, but it turns out
that the doctest is not actually run. While converting the doctest to
unittest style, I stumbled upon this bug again and this time applied the
code patch provided by Filip Gruszczyński.
The goal of the regex is to catch a (alpha), b (beta), c or rc
(release candidate), so the existing pattern puzzled me. Tests were
OK before and after the change.