note 80659 added to function.preg-quote

From: Date: Mon, 28 Jan 2008 07:37:43 +0000
Subject: note 80659 added to function.preg-quote
Groups: php.notes 
Request: Send a blank email to php-notes+get-135452@lists.php.net to get a copy of this message
Note that as of ver 5.2.5 this function does not replace the dash (`-') character. This can cause problems if you are going to put the quoted string in square brackets in the regular expression. Do something like: <?php function pregquote($str) { return str_replace('-', '\\-', preg_quote($str)); } ?> ---- Server IP: 202.79.178.91 Probable Submitter: 202.156.13.1 (proxied: 202.156.26.185) ---- Manual Page -- http://www.php.net/manual/en/function.preg-quote.php Edit -- https://master.php.net/note/edit/80659 Del: integrated -- https://master.php.net/note/delete/80659/integrated Del: useless -- https://master.php.net/note/delete/80659/useless Del: bad code -- https://master.php.net/note/delete/80659/bad+code Del: spam -- https://master.php.net/note/delete/80659/spam Del: non-english -- https://master.php.net/note/delete/80659/non-english Del: in docs -- https://master.php.net/note/delete/80659/in+docs Del: other reasons-- https://master.php.net/note/delete/80659 Reject -- https://master.php.net/note/reject/80659 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#135452) next »