Skip to content

Instantly share code, notes, and snippets.

@markrwilliams
Created May 19, 2013 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markrwilliams/5608501 to your computer and use it in GitHub Desktop.
Save markrwilliams/5608501 to your computer and use it in GitHub Desktop.
import re
URL = re.compile('^((?P<scheme>[^:/?#]+):)?'
'(//(?P<authority>[^/?#]*))?'
'(?P<path>[^?#]*)'
'(\?(?P<query>[^#]*))?'
'(#(?P<fragment>.*))?')
print URL.match('http://fake.com:8080/search?q=123&business=Nothing%20Special').groupdict()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment