mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-13 06:50:08 +01:00
avoid duplicate pattern groups
Since patterns are always wrapped in a named group anyway, we don't need to do another unnamed group also. This makes the regular expressions more readable.
This commit is contained in:
parent
4c8c9b128a
commit
2f421daf16
2 changed files with 31 additions and 25 deletions
|
|
@ -64,27 +64,27 @@ PART_PATTERNS = {
|
|||
'GG' : r"[1-9][0-9]?",
|
||||
'0G' : r"[0-9]{2}",
|
||||
'Q' : r"[1-4]",
|
||||
'MM' : r"(?:1[0-2]|[1-9])",
|
||||
'0M' : r"(?:1[0-2]|0[1-9])",
|
||||
'DD' : r"(?:3[0-1]|[1-2][0-9]|[1-9])",
|
||||
'0D' : r"(?:3[0-1]|[1-2][0-9]|0[1-9])",
|
||||
'JJJ' : r"(?:36[0-6]|3[0-5][0-9]|[1-2][0-9][0-9]|[1-9][0-9]|[1-9])",
|
||||
'00J' : r"(?:36[0-6]|3[0-5][0-9]|[1-2][0-9][0-9]|0[1-9][0-9]|00[1-9])",
|
||||
'MM' : r"1[0-2]|[1-9]",
|
||||
'0M' : r"1[0-2]|0[1-9]",
|
||||
'DD' : r"3[0-1]|[1-2][0-9]|[1-9]",
|
||||
'0D' : r"3[0-1]|[1-2][0-9]|0[1-9]",
|
||||
'JJJ' : r"36[0-6]|3[0-5][0-9]|[1-2][0-9][0-9]|[1-9][0-9]|[1-9]",
|
||||
'00J' : r"36[0-6]|3[0-5][0-9]|[1-2][0-9][0-9]|0[1-9][0-9]|00[1-9]",
|
||||
# week numbering parts
|
||||
'WW': r"(?:5[0-2]|[1-4][0-9]|[0-9])",
|
||||
'0W': r"(?:5[0-2]|[0-4][0-9])",
|
||||
'UU': r"(?:5[0-2]|[1-4][0-9]|[0-9])",
|
||||
'0U': r"(?:5[0-2]|[0-4][0-9])",
|
||||
'VV': r"(?:5[0-3]|[1-4][0-9]|[1-9])",
|
||||
'0V': r"(?:5[0-3]|[1-4][0-9]|0[1-9])",
|
||||
'WW': r"5[0-2]|[1-4][0-9]|[0-9]",
|
||||
'0W': r"5[0-2]|[0-4][0-9]",
|
||||
'UU': r"5[0-2]|[1-4][0-9]|[0-9]",
|
||||
'0U': r"5[0-2]|[0-4][0-9]",
|
||||
'VV': r"5[0-3]|[1-4][0-9]|[1-9]",
|
||||
'0V': r"5[0-3]|[1-4][0-9]|0[1-9]",
|
||||
# non calver parts
|
||||
'MAJOR' : r"[0-9]+",
|
||||
'MINOR' : r"[0-9]+",
|
||||
'PATCH' : r"[0-9]+",
|
||||
'BUILD' : r"[0-9]+",
|
||||
'BLD' : r"[1-9][0-9]*",
|
||||
'RELEASE': r"(?:preview|final|alpha|beta|post|pre|dev|rc|a|b|c|r)",
|
||||
'PYTAG' : r"(?:post|dev|rc|a|b)",
|
||||
'RELEASE': r"preview|final|alpha|beta|post|rc",
|
||||
'PYTAG' : r"post|rc|a|b",
|
||||
'NUM' : r"[0-9]+",
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue