我有一个场景,用户可以在文本字段中输入网址,我需要从中返回 URI。
因此,用户可能会以以下完整状态输入地址-
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
从所有这些示例中,我需要返回:
/controller/function?stuff=thing
(请注意,域名可以是任何东西,而不仅仅是谷歌!)