|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #70981 preg back-reference page needs $n form
Submitted: 2015-11-26 23:44 UTC Modified: 2015-11-27 18:46 UTC
From: dave at dbarc dot net Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2015-11-26 23:44 UTC] dave at dbarc dot net
From manual page:
(If I'm off-base here, just ignore me)
This page should have the "$n" form of the backreference. "being the preferred one".  See


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-11-27 00:23 UTC]
-Status: Open +Status: Not a bug
 [2015-11-27 00:23 UTC]
This is not a bug. It seems you are confusing back references within a pattern, with references in a replacement string.

Numeric back references are used within a regex pattern to match what has been matched by an earlier (more left) subpattern. These use the backslash-number syntax only.

Replacement strings can use the backslash-number syntax, or the alternative and preferred dollar-number syntax, to refer to subpatterns from the match, to insert into the replacement.
 [2015-11-27 18:46 UTC] dave at dbarc dot net
Thanks. And thanks for being polite.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jan 23 02:01:25 2021 UTC