|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2623 Escaping a backslash doesn't seem to work in preg_replace
Submitted: 1999-10-27 13:02 UTC Modified: 1999-10-28 12:42 UTC
From: rob dot duarte at fmr dot com Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0.12 OS: Solaris 2.5.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: rob dot duarte at fmr dot com
New email:
PHP Version: OS:


 [1999-10-27 13:02 UTC] rob dot duarte at fmr dot com
$url = preg_replace( "/\\/", "/", $var);

This returns...

Warning: No ending delimiter found in /usr/local/apache/htdocs/projects/documentation.php3 on line 18


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1999-10-27 13:10 UTC] rob dot duarte at fmr dot com

$url = preg_replace( "/\\134/", "/", $var);

 [1999-10-28 12:42 UTC] andrei at cvs dot php dot net
This has been fixed in CVS.
Since PHP does its own backslashing in strings, in order for your
pattern to work properly it would need to look like:

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Dec 04 13:01:27 2023 UTC