4 ms·
John Gruber (of daringfireball.com) came up with a regex for extracting URLs from text (Twitter-like) years ago, and has improved it since. The current version
by eridius 12y ago
John Gruber (of daringfireball.com) came up with a regex for extracting URLs from text (Twitter-like) years ago, and has improved it since. The current version is found at https://gist.github.com/gruber/249502 https://gist.github.com/gruber/249502.
I haven't tested it myself, but it's worth looking at.
Original post: http://daringfireball.net/2009/11/liberal_regex_for_matching_urls http://daringfireball.net/2009/11/liberal_regex_for_matching...
Updated version: http://daringfireball.net/2010/07/improved_regex_for_matching_urls http://daringfireball.net/2010/07/improved_regex_for_matchin...
Most recent announcement, which contained the Gist URL: http://daringfireball.net/linked/2014/02/08/improved-improved-regex http://daringfireball.net/linked/2014/02/08/improved-improve...
- masklinn 12y agoIsn't it the @gruber v2 column from the page? It looks to have no false negative, but many false positives. The only one which does perfect on the tested set is Diego Perini's https://gist.github.com/dperini/729294 https://gist.github.com/dperini/729294
- eridius 12y agoHrm, you're right. I managed to miss seeing that while skimming the page.