Skip to content

Commit

Permalink
Merge pull request #248 from kiblik/master
Browse files Browse the repository at this point in the history
(fix)semver: SyntaxWarning: invalid escape sequence
  • Loading branch information
cblakkan authored Apr 30, 2024
2 parents 96fc7eb + e13f6f5 commit 9ed68e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yamale/validators/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ class Mac(Regex):
def __init__(self, *args, **kwargs):
super(Mac, self).__init__(*args, **kwargs)
self.regexes = [
re.compile("[0-9a-fA-F]{2}([-:]?)[0-9a-fA-F]{2}(\\1[0-9a-fA-F]{2}){4}$"),
re.compile("[0-9a-fA-F]{4}([-:]?)[0-9a-fA-F]{4}(\\1[0-9a-fA-F]{4})$"),
re.compile(r"[0-9a-fA-F]{2}([-:]?)[0-9a-fA-F]{2}(\1[0-9a-fA-F]{2}){4}$"),
re.compile(r"[0-9a-fA-F]{4}([-:]?)[0-9a-fA-F]{4}(\1[0-9a-fA-F]{4})$"),
]


Expand All @@ -257,7 +257,7 @@ def __init__(self, *args, **kwargs):
super(SemVer, self).__init__(*args, **kwargs)
self.regexes = [
# https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
re.compile("^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"),
re.compile(r"^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"),
]


Expand Down

0 comments on commit 9ed68e9

Please sign in to comment.