Regular expressions
This commit is contained in:
@@ -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,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user