Detecting URLs within a string PHP and Javascript – Mr. Joel Kemp

Screen Shot 2013 03 20 At 1.59.53 Pm

I had to roll my own regex solution for translating embedded links within text to clickable html links. Stuff on the web had too many false positives. Hope it helps!





Properly detects the urls in the following formats:


Including subpaths: