Req #47456 [Opn->Csd]: Missing PCRE option 'J'
| From: | cmb@php.net | Date: | Mon, 05 Sep 2016 08:29:35 +0000 |
| Subject: | Req #47456 [Opn->Csd]: Missing PCRE option 'J' | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-203800@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=47456&edit=1
ID: 47456
Updated by: cmb@php.net
Reported by: rodricg at sellingsource dot com
Summary: Missing PCRE option 'J'
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: PCRE related
Operating System: Linux
PHP Version: 5.3CVS-2009-02-19 (CVS)
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Implemented: <https://github.com/php/php-src/commit/c4fe264b>.
Previous Comments:
------------------------------------------------------------------------
[2009-02-19 23:47:05] rodricg at sellingsource dot com
Didn't see how else to include this diff for php_pcre.c
http://diff.pastebin.com/f5639d5a5
------------------------------------------------------------------------
[2009-02-19 23:36:11] felipe@php.net
Currently you can only use PCRE_INFO_JCHANGED by (?J) in the pattern. I have suggested times ago to
the maintainer, but it wasn't accept the addiction of 'J' as valid modifier in the
extension.
Anyway, assigned to maintainer.
------------------------------------------------------------------------
[2009-02-19 23:12:33] rodricg at sellingsource dot com
Description:
------------
The PCRE extension does not recognize the 'J' option for setting PCRE_DUPNAMES.
Reproduce code:
---------------
<?php
preg_match_all('/(?<chr>[ac])(?<num>\d)|(?<chr>[b])/J',
'a1bc3', $m, PREG_SET_ORDER);
print_r($m);
?>
Expected result:
----------------
Array
(
[0] => Array
(
[0] => a1
[chr] => a
[1] => a
[num] => 1
[2] => 1
)
[1] => Array
(
[0] => b
[chr] => b
[1] =>
[num] =>
[2] =>
[3] => b
)
[2] => Array
(
[0] => c3
[chr] => c
[1] => c
[num] => 3
[2] => 3
)
)
Actual result:
--------------
PHP Warning: preg_match(): Unknown modifier 'J' in ....
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=47456&edit=1