diff --git a/new_version.py b/new_version.py index 46e6c7ae4e..a261c99add 100755 --- a/new_version.py +++ b/new_version.py @@ -70,9 +70,11 @@ break OLD_VERSION_SUFFIX = f"(-{OLD_VERSION_TAG})?" if OLD_VERSION_TAG else "" +# The order of the alternatives is important, since the Regex parser +# should greedily include the old version suffix OLD_VERSION_STR = \ - f"({re.escape(OLD_VERSION_STR_README)})" + \ - f"|({re.escape(OLD_VERSION_STR_CMAKE)}{OLD_VERSION_SUFFIX})" + f"({re.escape(OLD_VERSION_STR_CMAKE)}{OLD_VERSION_SUFFIX})" + \ + f"|({re.escape(OLD_VERSION_STR_README)})" print(f"The old version is: {OLD_VERSION_STR}") print()