replace text with regex php, I got this error : <pre><code>&lt;html&gt;
&lt;body&gt;
&lt;form name='form' method='post' action=""&gt;
Dork: &lt;input type="text" name="dork" id="dork" &gt;
&lt;input type="submit" name="submit" value="Submit"&gt;  
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;?php 
$ptn = "/(?:[a-z]{4,5}://[a-z.0-9]*\/)?([a-z.\?_=]*)([0-9]*)/";  // Regex
$str = $_POST['dork']; //Your input, perhaps $_POST['textbox'] or whatever
$rpltxt = "$1";  // Replacement string
echo preg_replace($ptn, $rpltxt, $str);
?&gt;
</code></pre>

<p>I got this error</p>

<pre><code>Warning: preg_replace(): Unknown modifier '/'
</code></pre>

<p>How to fix it like this
<a href="http://prntscr.com/ex29j2" rel="nofollow noreferrer">http://prntscr.com/ex29j2</a></p>
