I\'m trying to find a reliable solution to extract a url from a string of characters. I have a site where users answer questions and in the source box, where they enter thei
Yahoo! Answers does a fairly good job of link identification when the link is written properly and separate from other text, but it isn't very good at separating trailing punctuation. For example The links are http://example.com/somepage.php, http://example.com/somepage2.php, and http://example.com/somepage3.php. will include commas on the first two and a period on the third.
But if that is acceptable, then patterns like this should do it:
\
It looks like stackoverflow's parser is better. Is is open source?