I am looking for a PHP function that can convert

replies in a string to a link leading to their profile.
I have already found a function to convert plain text to URLs when "http://" or "www." is present, but I can't find a working one for

replies. I found one that didn't seem to do anything at all, and I think I'm just not using the right keywords.
Basically I want "

robmonroe" to be converted to:
Code:
@<a href="http://twitter.com/robmonroe">robmonroe</a>
If you know how, or have a link to a snippet, that'd be awesome.