diff options
Diffstat (limited to 'methods.py')
-rw-r--r-- | methods.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/methods.py b/methods.py index 6f1e7a7279..1afd1ca0d4 100644 --- a/methods.py +++ b/methods.py @@ -787,9 +787,18 @@ def get_compiler_version(env): return None else: # TODO: Implement for MSVC return None - match = re.search("[0-9]+\.[0-9.]+", version) + match = re.search( + "(?:(?<=version )|(?<=\) )|(?<=^))" + "(?P<major>\d+)" + "(?:\.(?P<minor>\d*))?" + "(?:\.(?P<patch>\d*))?" + "(?:-(?P<metadata1>[0-9a-zA-Z-]*))?" + "(?:\+(?P<metadata2>[0-9a-zA-Z-]*))?" + "(?: (?P<date>[0-9]{8}|[0-9]{6})(?![0-9a-zA-Z]))?", + version, + ) if match is not None: - return list(map(int, match.group().split("."))) + return match.groupdict() else: return None |