Skip to content

Commit

Permalink
Allow URL auth.
Browse files Browse the repository at this point in the history
  • Loading branch information
pcinkh authored and Deepwalker committed Mar 1, 2017
1 parent de14a07 commit 9e12d85
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions trafaret/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,11 +699,12 @@ class URL(String):
"""

regex = re.compile(
r'^(?:http|ftp)s?://' # http:// or https://
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' #domain...
r'localhost|' #localhost...
r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip
r'(?::\d+)?' # optional port
r'^(?:http|ftp)s?://' # http:// or https://
r'(?:\S+(?::\S*)?@)?' # user and password
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' # domain...
r'localhost|' # localhost...
r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip
r'(?::\d+)?' # optional port
r'(?:/?|[/?]\S+)$', re.IGNORECASE)
min_length = None
max_length = None
Expand Down

0 comments on commit 9e12d85

Please sign in to comment.