Posted in Code Regular Expression Twitter Linker Binny V A June 16, 2009 3 Comments on Regular Expression Twitter Linker Regular expression to link twitter users… Replace this '@(\w+)' With this '<a href="http://twitter.com/\1">@\1</a>' Author: Binny V AA philosopher programmer who specializes in backend development and stoicism.
3 thoughts on “Regular Expression Twitter Linker”
Binny, I didnt understand a word of that 🙁
I am interested because its related to twitter, can you give some insight for this no-bie.. ?
Tell me what it is supposed to do, one application of this code..
Say you write a post about twitter meetup – and put in a lot of twitter handles like @binnyva and @arunbasilllal. Then you decide that you need to link the usernames to their twitter profile. Either you could go and edit all the handles manually, or you could do a regular expression replace.
It basically replaces a specific string pattern with another pattern. I hope I have made it clear for you. And please curse your college for not teaching your useful stuff like this(this topic was covered in BCK5 in my talk).
My college never teach me anything I need to know, but gave me some awesome friends and a chance to meet a lot of people. Helps in character formation 😀
Now got a better picture, but it would be ages when I would be using it somewhere. Hey, cant say actually, life changes in no time… 🙂