#42964 [Opn->Bgs]: \G already supported
| From: | felipensp at gmail dot com | Date: | Fri, 16 Nov 2007 15:57:15 +0000 |
| Subject: | #42964 [Opn->Bgs]: \G already supported | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-210@lists.php.net to get a copy of this message | ||
ID: 42964
User updated by: felipensp at gmail dot com
Reported By: felipensp at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Documentation problem
Operating System: Linux
PHP Version: Irrelevant
New Comment:
The Perl \G works different with PCRE \G, it accepts multiples ERs
using same position referenced by \G. The PCRE \G is documented in same
page, and it's used in single pattern.
Previous Comments:
------------------------------------------------------------------------
[2007-10-14 22:11:23] felipensp at gmail dot com
Description:
------------
"The Perl \G assertion is not supported as it is not relevant to single
pattern matches." Said the documentation at
http://br2.php.net/manual/en/reference.pcre.pattern.syntax.php
But, \G works in PCRE currently.
Reproduce code:
---------------
<?php
preg_match_all('/\Ga/', 'abaa', $matches);
print_r($matches);
preg_match_all('/\Ga/', 'aaba', $matches);
print_r($matches);
preg_match_all('/a/', 'abaa', $matches);
print_r($matches);
?>
Actual result:
--------------
Array
(
[0] => Array
(
[0] => a
)
)
Array
(
[0] => Array
(
[0] => a
[1] => a
)
)
Array
(
[0] => Array
(
[0] => a
[1] => a
[2] => a
)
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42964&edit=1