What is wrong with web site like RegExLib.com ("url" section) ?
You should find what you need and test it for yourself there.
Anyway, this regex validate what you wants and exclude what you do not want.
(?ms)^(https?|ftp|telnet):\/\/((?:(?:(?=[^\r\n]*@)\w|-)+(?:(?::)(?:\w|-)+)?)?)@?((?:(?:(?:\w|-)+)\.)+(?:\w|-)+)(\:\d+)?((?:(?:/(?:\w|-)+(?:\.(?:\w|-)+)?)+)?)((?:\?(?:(?:\w|-)+\=(?:\w|[\.\-\*\:\+\#])*\&?)+)*)$
with:
- group 1: protocol
- group 2: username[:password]
- group 3: domain (www.xxx)
- group 4: empty
- group 5: address (XX/yyy/zzzz)
- group 6: parameters (?key1a=value1a&key2a=value2a?key1b=value1b&key2b=value2b...)