Use url.parse() instead of regexp