From 7d94cea471bf7cab8248d6d6e0822ac21a182f38 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Tue, 24 Jun 2014 09:28:23 -0500 Subject: [PATCH] Regular expressions --- rfc3986/misc.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/rfc3986/misc.py b/rfc3986/misc.py index dcf440d..6b4c202 100644 --- a/rfc3986/misc.py +++ b/rfc3986/misc.py @@ -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}):(//(?P{authority})|' + '(?P{path}))').format({ + 'scheme': scheme_pattern, + 'authority': authority_pattern, + 'path': path_pattern, + })