I\'ve been using the following site to test a PHP regex so I don\'t have to constantly upload: http://www.spaweditor.com/scripts/regex/index.php
I\'m using the follo
just an actual example of @Asaph solution. In this example ou don't need non-greediness because you can specify a count. replace just the first occurrence of @ in a line with a marker
$line=preg_replace('/@/','zzzzxxxzzz',$line,1);