note 23587 deleted from function.preg-replace by sniper
| From: | sniper@php.net | Date: | Sun, 07 Sep 2003 22:05:44 +0000 |
| Subject: | note 23587 deleted from function.preg-replace by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-55702@lists.php.net to get a copy of this message | ||
Note Submitter: guidod@gmx.de
----
always remember that the capture-texts $1..$n are run through addslashes() for the /e-case,
converting \,'," into \\,\',\". The /e-val will handle quotations however
reducing just two of the three backslashes back for quoted $1..$n-arguments
"my_func(\"$1\")" reduces \\ and \" but not \'
"my_func('$1')" reduces \\ and \' but not \"
Therefore the remaining escaped quotationmark is seen by the function and a str_replace
'\"','"', must be used there to get at the original captured text.