Parse uris without using regular expressions