Input Base Valid Output https:example.org https://example.org/ https://////example.com/// https://example.com/// https://example.com/././foo https://example.com/foo hello:world https://example.com/ hello:world https:example.org https://example.com/ https://example.com/example.org \example\..\demo/.\ https://example.com/ https://example.com/demo/ example https://example.com/demo https://example.com/example file:///C|/demo file:///C:/demo .. file:///C:/demo file:///C:/ file://loc%61lhost/ file:/// https://user:[email protected]/ https://user:[email protected]/ https://example.org/foo bar https://example.org/foo%20bar https://EXAMPLE.com/../x https://example.com/x https://ex ample.org/ Failure example , due to lack of base Failure https://example.com:demo Failure http://[www.example.com]/ Failure