|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12140 pcre_replace change behavior with \
Submitted: 2001-07-13 08:51 UTC Modified: 2001-08-06 12:58 UTC
From: madmax at express dot ru Assigned:
Status: Closed Package: PCRE related
PHP Version: 4.0.6 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
18 + 22 = ?
Subscribe to this entry?

 [2001-07-13 08:51 UTC] madmax at express dot ru
need replace \ (one) to \\\\ (four)

On php.4.0.5 work:

On php 4.0.6 work:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-06 12:58 UTC]
That's right. Your  \\\\\\\\ turns into \\\\ by the time PHP string parsing is done with it. Then the extension looks at it and sees two escaped backslashes so that's what you get - two backslashes.

In general, use str_replace() for things like that.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu May 13 04:01:23 2021 UTC