PHP preg_replace: PHP Error[2]: preg_replace(): Delimiter must not be alphanumeric or backslash
<p>trying to replace string once and getting this error would appriciate any help.</p>

<pre><code>$link = '&lt;a href="'.$url.'" title="'.$anchor.'"&gt;'.$anchor.'&lt;/a&gt; ';
$text = preg_replace(/" ".$anchor." "/,"", $text,1);
</code></pre>

<p>Getting this error message:</p>

<pre><code>Error[2]: preg_replace(): Delimiter must not be alphanumeric or backslash
</code></pre>

<p>Any idea? All I want is just to replace the first ocurance of text with a link</p>
