title: Unknown modifier in preg_match() statement
body: <p>After 2 attempts (thanks to Stack Overflow) I finally got my regex url to work and blacklist specific things in different ways as I wanted. However, it doesn't work properly, whilst yes; it does blacklist the words and prevent them being entered into the database, it throws up an error:</p>
  
  <blockquote>
    <p>PHP Warning:  preg_match() [function.preg-match]: Unknown modifier
    '\\' in C:\wamp\www\anonpost\index.php on line 324, referer:
    <a href="http://localhost/anonpost/index.php" rel="nofollow">http://localhost/anonpost/index.php</a></p>
  </blockquote>
  
  <p>And here's my code:</p>
  
  <pre><code>$disallowedWords1 = array(
  'offensive','words'
  );
  
  foreach ($disallowedWords1 as $word1) {
    if (preg_match("/\b$word1\b/i", $entry)) {
      die('The word or phrase ' . $word . ' is not allowed...');
    }
  }
  
  $urlRegex = '(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&amp;amp;%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\?\'\\\+&amp;amp;%\$#\=~_\-]+))*';
  if (preg_match($urlRegex, $entry)) {
    die('The word or phrase ' . $word . ' is not allowed...');
  
  } 
  </code></pre>
  
  <p>I looked at some posts that were similar on the site, they all pretty much made the point that there were no delimiter's, well I have those, so I am really lost as to what it could be. Any help would be appreciated :)</p>
  
  <p>(For an example of the error's, of which there are three [three different preg_match() statements, each only marginally different, mainly the way it finds the text] try posting, it's not a problem, it just makes it look messy: <a href="http://aviatex14.co.uk/anonpost/" rel="nofollow">http://aviatex14.co.uk/anonpost/</a> )</p>