<html>
<body>
<form name='form' method='post' action="">
Dork: <input type="text" name="dork" id="dork" >
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
<?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);
?>
I got this error
Warning: preg_replace(): Unknown modifier '/'
How to fix it like this http://prntscr.com/ex29j2