i encountered problems in detecting URL from a given string, i need to know the url's location in the string. i programmed a little program but it can't fulfill my demands.

for example, there is a string like "example: www.codeguru.com and www.microsoft.com/msn, two URLs"

then the program should be able to detect the "www.codeguru.com" and the "www.microsoft.com/msn". can anyone give me some hint? thanks a lot.