Twitter-text: libraries for identifying URLs, at mentions, hashtags in text
github.com
github.com
The URL extraction functions are quite robust and handled the task well. This library has use cases beyond just parsing Twitter tweets.
Identifying things in plaintext is one of those things that seems very simple but ends up being a pain to get right if you want it to be robust enough to handle all the corner cases.
There's a reason why this library has over 2k commits! I'd hate to have to rediscover all the lessons they must have learned the hard way...