
How to split URL without http:// using RegEx?
Hi guys,
I'm looking for a regular expression to find and split up URL's with or
without http://, ftp:// etc. Basically I want it to work like this one:
^(.{2,6}://)?([^/]*)?(.*)
Although this one works only if the string sent to RegExp only contains the
URL to be split. I've tried to modify it to handle a string where the URL
should be found first and then split, but I failed. How should I do this?
Examples on how to find URLs including the protocol is easy to find, but I
haven't found any example on how to find URLs without the protocol.
Thanks for any kind of help.
Regards,
Jonah Olsson