ID:               47456
 User updated by:  rodricg at sellingsource dot com
 Reported By:      rodricg at sellingsource dot com
 Status:           Assigned
 Bug Type:         PCRE related
 Operating System: Linux
 PHP Version:      5.3CVS-2009-02-19 (CVS)
 Assigned To:      nlopess
 New Comment:

Didn't see how else to include this diff for php_pcre.c
http://diff.pastebin.com/f5639d5a5


Previous Comments:
------------------------------------------------------------------------

[2009-02-19 23:36:11] [email protected]

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 http://bugs.php.net/?id=47456&edit=1

Reply via email to