php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #3674 Backreferences need 2 backslashes to work in preg_* functions
Submitted: 2000-02-29 20:56 UTC Modified: 2001-04-16 05:53 UTC
From: sergio at ing dot puc dot cl Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.0 OS: Redhat Linux 6.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sergio at ing dot puc dot cl
New email:
PHP Version: OS:

 

 [2000-02-29 20:56 UTC] sergio at ing dot puc dot cl
In the documentation it says that the backreferences should be used with one backslash.  Well, it doesn't work.  But, in the preg_replace documentation examples that you should use 2 backslashes (and it works in all functions the second way)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-10 14:39 UTC] jimw@php.net
refiled against 4.0. the sections of pcre.xml lifted from the pcre docs probably needs a caveat added about how backslashes need to be handled.
 [2001-04-16 05:53 UTC] jmoore@php.net
This has been corrected in documentation.

-James
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 17:02:17 2025 UTC