title: preg_replace regex requires forward slash open and close?
body: <p>I'm trying to learn regular expressions. I was testing myself by trying to check an email account. The problem though is it's coming up with an error:</p>
  
  <p>No ending delimiter '^' found in /www/eh11522/public_html/scclib/demo/regex.php on line 8</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;?php
  $pattern = "^([\w.]+)@w([\w.]+).([\w.]+)";
  $email = "tyler@surazinet";
  
  if (!preg_replace($pattern, '', $subject)) {
  echo "worked";
  } else {
  echo "failed";
  }
  
  ?&gt;
  </code></pre>
  
  <p>I found that it will work if I put a slash before and after the pattern, but I don't quite understand what that does, and that doesn't quite match what I want it to.</p>