A Good URL Regular Expression

(^|[ \t\r\n])((ftp|http|https|gopher|mailto|news|nntp|telnet|wais|

Regular Expressions are magical. Up until now I always discarded them as being to “geeky”, meaning I don’t consider it my life’s biggest goal to be typing (/?[]\w) all day long.

Regular expression that validates URLs not URL domains. One that doesn’t allow spaces in the domain name and where the domain can be suffixed with the port number. It also supports ~/ paths, and sub folders.

Should parse the URL below:

But not:
http://hh-1hallo. msn.blablabla.com:80800/test/test.aspx?dd=dd&id=dki

I hope that this helps people.