Regular expressions

This commit is contained in:
Ian Cordasco
2014-06-24 09:28:23 -05:00
parent e52afe98a8
commit 7d94cea471

View File

@@ -7,3 +7,16 @@ GENERIC_DELIMITERS = (":", "/", "?", "#", "[", "]", "@")
# Delimiters of subcomponents
SUB_DELIMITERS = ("!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=")
RESERVED_CHARS = general_delimiters + sub_delimiters
scheme_pattern = '\w[\w\d+-.]*'
authority_pattern = '[^/?#]+'
path_pattern = '.*' # FIXME
userinfo_pattern = ''
expression = ('(?P<scheme>{scheme}):(//(?P<authority>{authority})|'
'(?P<path>{path}))').format({
'scheme': scheme_pattern,
'authority': authority_pattern,
'path': path_pattern,
})