Can someone help me with splitting up a URL using a regular expression, please?
The expression will have to cope with these example URL variants:
apple.com
www.orange.com
www.banana.com/
www.grape.com/blar/blar/
www.pineapple.co.uk/blar/blar.html
forum.plum.net/
Basically, I will want to replace the domain with something else. For sake of this example, lets just say a static string of 'yahoo' for now. So for instance, I would like the regular expression to change the above examples to:
yahoo.com
www.yahoo.com
www.yahoo.com/
www.yahoo.com/blar/blar/
www.yahoo.co.uk/blar/blar.html
forum.yahoo.net/
The URLs are not prefixed with http:// etc, and the top level domains (.com, .co.uk, .net, etc) could be any legal TLD.