#34562 [Opn->Bgs]: Backslash escaping doesn't work
| From: | sniper@php.net | Date: | Tue, 20 Sep 2005 11:16:53 +0000 |
| Subject: | #34562 [Opn->Bgs]: Backslash escaping doesn't work | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-85275@lists.php.net to get a copy of this message | ||
ID: 34562
Updated by: sniper@php.net
Reported By: techtonik@php.net
-Status: Open
+Status: Bogus
Bug Type: PCRE related
Operating System: Windows 2000
PHP Version: 4.4.0
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2005-09-20 13:11:34] techtonik@php.net
Description:
------------
Usually, if you want to match a backslash, you write "\\", but this
doesn't work no matter what kind of quotes do you use.
Reproduce code:
---------------
<?php
$str = 'slash\replace';
echo $str = preg_replace('!\\+!', '/', $str);
preg_replace('![/\\]+!', '/', $str); // warning
?>
Expected result:
----------------
slash/replace
Actual result:
--------------
slash\replace
Warning: preg_replace(): Compilation failed: missing terminating ] for
character class at offset 5 i
n C:\MyFiles.XFiles\Numerald\tc\test69\testcase.php on line 7
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34562&edit=1