Skip to content

Commit

Permalink
Merge pull request #1 from houghcr/patch-1
Browse files Browse the repository at this point in the history
tweak regexes
  • Loading branch information
apinsard committed Jul 29, 2015
2 parents e42f170 + 90316a7 commit f281f3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chuse
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ def parse_atom(atom: "A raw atom as a string") -> "The atom parts as a dict":
parts = ['selector', 'cat', 'pkg', 'version', 'slot']
selector_ptrn = r'(?P<selector>>=|<=|<|=|>)'
cat_ptrn = r'(?P<cat>[a-z0-9]+(-[a-z0-9]+)?)'
pkg_ptrn = r'(?P<pkg>[a-z0-9]+(-[a-z0-9]+)*)'
version_ptrn = r'(?P<version>[0-9]+(\.[0-9]+)*(-r[0-9]+)?)'
pkg_ptrn = r'(?P<pkg>[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*\+?)'
version_ptrn = r'(?P<version>[0-9]+(\.[0-9]+)*(_[a-zA-Z]+)?([0-9]+)?(-r[0-9]+)?[a-z]?)'
slot_ptrn = r'(?P<slot>.*)'

pattern = '^' + selector_ptrn + '?' + cat_ptrn + '/' + pkg_ptrn + \
Expand Down

0 comments on commit f281f3c

Please sign in to comment.