Doc #62428 [PATCH]: PCRE "\g" escape missing "<name>" in documentation
Edit report at https://bugs.php.net/bug.php?id=62428&edit=1
ID: 62428
Patch added by: cmb@php.net
Reported by: danielklein at airpost dot net
Summary: PCRE "\g" escape missing "<name>" in documentation
Status: Open
Type: Documentation Problem
Package: PCRE related
PHP Version: 5.4.4
Block user comment: N
Private report: N
New Comment:
The following patch has been added/updated:
Patch Name: angle-brackets
Revision: 1429789995
URL: https://bugs.php.net/patch-display.php?bug=62428&patch=angle-brackets&revision=1429789995
Previous Comments:
------------------------------------------------------------------------
[2015-04-23 11:52:59] cmb@php.net
Indeed, \g<name> is not documented yet. The feature is available
since 5.2.7.[1]
[1] <http://3v4l.org/tfeSh>
------------------------------------------------------------------------
[2015-04-23 03:34:47] danielklein at airpost dot net
I don't see any change. Where does it say \g<name> in the documentation?
------------------------------------------------------------------------
[2015-04-15 14:15:31] ppaisndud at gmail dot com
Documentation has been fixed, can be closed
------------------------------------------------------------------------
[2012-06-27 01:31:39] danielklein at airpost dot net
Description:
------------
http://www.php.net/manual/en/regexp.reference.back-references.php
PCRE also allows "\g" to use "<name>". I don't know since which
version of PHP, but going by the existing documentation it should have been between 5.2.2 and 5.2.4.
Please make note of this in the documentation.
Test script:
---------------
<?php
var_dump(preg_match('/(?<bar>o)\g<bar>/', 'foo'));
?>
Actual result:
--------------
int(1)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62428&edit=1
Thread (9 messages)