def link_twitter_user(txt) if match = txt.match(/.*?(@)((?:[a-z][a-z]+))(:|\s)/i) user = match[2] txt.gsub!(user, '<a href="http://twitter.com/' + user + '">' + user + '</a>') end txt end
You need to create an account or log in to post comments to this site.