I have a scenario where a user can enter a web address into a text field and I need to return the URI from it.
So a user could potentially enter addresses in the following state of fullness-
http://www.google.co.uk/contoller/function?stuff=thing
www.google.co.uk/controller/function?stuff=thing
google.co.uk/controller/function?stuff=thing
/controller/function?stuff=thing
controller/function?stuff=thing
From all of these examples I would need to return:
/controller/function?stuff=thing
(please note that that the domain could be anything, not just google!)