title: PHP: string to regex
body: <p>I try use string as a regular expression pattern but I've following errors</p>
  
  <pre><code>PHP Warning:  preg_match(): Unknown modifier '&gt;' in /Applications/MAMP/htdocs/cruncher/Plugins/wordpress/WPDetect.php on line 22
  PHP Warning:  preg_match(): Unknown modifier '/' in /Applications/MAMP/htdocs/cruncher/Plugins/wordpress/WPDetect.php on line 22
  </code></pre>
  
  <p>The code</p>
  
  <pre><code>$str = "&lt;meta name=\"generator\" content=\"WordPress.com\" /&gt;"
  preg_match("/".$str."/", $content-&gt;content)
  </code></pre>
  
  <p>I also tried to use <code>preg_quote</code> function but I've similar problems.</p>
  
  <p>What is the correct way to make it work?</p>
  
  <p>Sultan</p>