it worked. Great. But not how I wanted. But still I can work on it now. Thanks for efforts.
If someone can develop this into a real plugin with some admin options please do. Its a nice idea. 🙂
I have written following code
function wp_external_links($text) {
$pattern = '/<a (.*?)href="(.*?)\/\/(.*?)"(.*?)>(.*?)<\/a>/';
$text= preg_replace_callback($pattern,'parse_external_links',$text);
return $text;
}
It does nothing. Here I am trying to replace all the occurence of <a href= with a prefix.