Escaping regex in php : <p>I have regexes stored in a txt file. How do I escape them in PHP? preg_quote doesn't help if I use the output in an array, throws fatal error. (The following each are on new lines in the txt file)</p>

<pre><code>/[^a-z\/'"]eval\([^\)]+['"\s\);]+/i
/\$auth_pass\s*=.+;/i
/document\.write\((['"])&lt;iframe .+&lt;\/iframe&gt;\1\);*/i
/preg_replace\s*\(.+[\/\#\|][i]*e[i]*['"].+\)/i
/&lt;\?.+?exec\(.+?system\(.+?passthru\(.+fwrite\(.+/s
/RewriteRule [^ ]+ http\:\/\/(?!127\.).*/i
/&lt;\?[\shp]*\@?error_reporting\(0\);.+?[a-z0-9\/\-\='"\.]{2000}.*?($|\?&gt;)/i
/\&lt;a [^\&gt;]+\&gt;\&lt;span style="color\:\#F1EFE4;"\&gt;(.+?)\&lt;\/span\&gt;\&lt;\/a\&gt;\&lt;span style="color\:\#F1EFE4;"\&gt;(.+?)\&lt;\/span\&gt;/i
/(&lt;!\d)\$[\$\{]*[a-z\-\_0-9]+[\} \t]*(\[[^\]]+\][ \t]*)*\(.*?\)\;/i
/\#(\w+)\#.+?\#\/\1\#/is
/(\$[a-z_0-9]+[=\s\@]+)?create_function\([^,]+,[\s\$\.\[\]a-z_0-9]+[\s\)]+;*/i
/json2\.min\.js/i
/(RewriteCond \%\{HTTP_USER_AGENT\} .+\s+)+RewriteRule \^.*\$ http:\/\/(?!127\.).*/i
/&lt;title&gt;[^&lt;]*hack[3e][rd]/i
</code></pre>
