I've recently been working with a simple Twitter API for PHP and came across this code to make @username be linked with twitter.com/username. Unfortunately this code creates it so @username links to http://twitter.com/@username, resulting in error. There are many parts to this code I do not understand, such as ^\v and others (seen below). Can anyone give me an explanation of what they signify?
$ret = preg_replace('/(^|[^\w])(@[\d\w\-]+)/', '\\1<a href="http://twitter.com/$2">$2</a>' ,$ret);