Edit report at https://bugs.php.net/bug.php?id=47456&edit=1

 ID:                 47456
 Updated by:         nlop...@php.net
 Reported by:        rodricg at sellingsource dot com
 Summary:            Missing PCRE option 'J'
-Status:             Assigned
+Status:             Open
 Type:               Feature/Change Request
 Package:            PCRE related
 Operating System:   Linux
 PHP Version:        5.3CVS-2009-02-19 (CVS)
-Assigned To:        nlopess
+Assigned To:        
 Block user comment: N
 Private report:     N



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] fel...@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

Reply via email to