# Anchor Tags
$tweet = preg_replace("@(https?://([-w.]+)+(:d+)?(/([w/_.]*(?S+)?)?)?)@", "[$1]($1)", $tweet);
# @ Replies
$tweet = preg_replace("/@([0-9a-zA-Z]+)/", "[@$1](http://twitter.com/$1)", $tweet);
# Hash Tags
$tweet = preg_replace("/#([0-9a-zA-Z]+)/", "[#$1](http://twitter.com/search?q=$1)", $tweet);