use urllib.parse and string split instead of regular expressions