From 459a40f1f59c6204182b9d010f68cb4b35dff828 Mon Sep 17 00:00:00 2001 From: Viktor Haag Date: Tue, 5 May 2015 13:12:52 -0400 Subject: [PATCH] Change regex for regular name Update the regular name regular expression to accept all of the characters allowed in the RFC. Closes #11 Change-Id: I92e7b9cb156d8dc8978c0dbf972ae3808b9913ba --- rfc3986/misc.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rfc3986/misc.py b/rfc3986/misc.py index 350ffb9..c599434 100644 --- a/rfc3986/misc.py +++ b/rfc3986/misc.py @@ -73,7 +73,11 @@ URI_MATCHER = re.compile(expression) # Host patterns, see: http://tools.ietf.org/html/rfc3986#section-3.2.2 # The pattern for a regular name, e.g., www.google.com, api.github.com -reg_name = '[\w\d.]+' +reg_name = '(({0})*|[{1}]*)'.format( + '%[0-9A-Fa-f]{2}', + important_characters['re_sub_delimiters'] + + important_characters['re_unreserved'] + ) # The pattern for an IPv4 address, e.g., 192.168.255.255, 127.0.0.1, ipv4 = '(\d{1,3}.){3}\d{1,3}' # Hexadecimal characters used in each piece of an IPv6 address