#20206 [Opn]: escape the escape char in preg_replace
| From: | tea at softhome dot net | Date: | Fri, 01 Nov 2002 07:43:41 +0000 |
| Subject: | #20206 [Opn]: escape the escape char in preg_replace | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-23880@lists.php.net to get a copy of this message | ||
ID: 20206
User updated by: tea@softhome.net
Reported By: tea@softhome.net
Status: Open
Bug Type: *Regular Expressions
Operating System: win2k sp3
PHP Version: 4.2.2
New Comment:
sorry, a typo in the second line of code
$_SESSION["l"] =
preg_replace("/\\*\//","\/",$_SESSION["l"]);
i missed a '/'.
Previous Comments:
------------------------------------------------------------------------
[2002-10-31 21:38:57] tea@softhome.net
let say:
$_SESSION["l"] = 'c/c++';
$_SESSION["l"] = preg_replace("/\\*\/","\/",$_SESSION["l"]);
$_SESSION["l"] = preg_replace("/\\*\+","\+",$_SESSION["l"]);
what i expect is no matter how the user reload the page
$_SESSION["l"] should be 'c\/c\+\+'
i used the reg exp in perl and tried it out, seems logically correct,
but it cause an error in my php page.
thx for your attention
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20206&edit=1