@ark_lamp_umbrella @privateger @seraph sorry to pick on you, but to anyone reading this: don't use regular expressions to parse your urls. Use a trusted library like urllib in Python or URI in .net.
There's way too many pitfalls, don't reinvent the wheel or you'll be like Elon.