Detecting URLs in text to be tweeted, code referenced in documentation needs to be updated


On the page of the documentation titled, “How Twitter wraps URLs with” (, it references various code libraries you can use to detect @mentions, hashtags, and urls in a string. This is great because it is extremely difficult to do, especially now that Twitter is turning non-http protocol text like “” into a link.

I wanted to do this for python and tried out the python library (, but found that the code has not be updated to recognize non-protocol links like “”.

Luckily, someone has done the work for Twitter (and me!), see

I hope someone at Twitter can either update the code they are referencing, or reference the code I just mentioned. Thanks!