Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004974 [Quercus] minor always 03-02-12 09:17 01-05-13 23:22
Reporter nemostein View Status public  
Assigned To nam
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 4.0.34 Product Version
  Product Build
Summary 0004974: Regex PCRE recursion (balancing groups) isn't working as expected in Quercus
Description When using a regex with recursive matching "(?R)" the result isn't what is expected.

______________________________
How to reproduce:
Run the following snippet

$subject = "{a{b{c}d}e}";
preg_match_all("
/
    {(
        (?:
            [^{}] | (?R)
        )*
    )}
    
/ixsm", $subject, $matches);
print_r($matches);

______________________________
What was expected:

Array
(
    [0] => Array
        (
            [0] => {a{b{c}d}e} // The whole match
        )

    [1] => Array
        (
            [0] => a{b{c}d}e // The 1st group
        )

)

______________________________
What is the result:

Array
(
    [0] => Array
        (
            [0] => {a{b{c}d}e} // The whole match is OK!
        )

    [1] => Array
        (
            [0] => c}d}e // The 1st group isn't.
        )

)

______________________________

The main problem is that the balance died at firs occurrence of "}"
Steps To Reproduce
Additional Information I'm using the Quercus bundle in the maven repository at:
http://caucho.com/m2/com/caucho/resin/4.0.23/ [^]

<dependency>
    <groupId>com.caucho</groupId>
    <artifactId>resin</artifactId>
    <version>4.0.23</version>
</dependency>
Attached Files

- Relationships

- Notes
(0006145)
nam
01-05-13 23:22

php/4eq2
php/4eq3

Fixed for 4.0.34.
 

- Issue History
Date Modified Username Field Change
03-02-12 09:17 nemostein New Issue
01-05-13 23:22 nam Status new => assigned
01-05-13 23:22 nam Assigned To  => nam
01-05-13 23:22 nam Status assigned => closed
01-05-13 23:22 nam Note Added: 0006145
01-05-13 23:22 nam Resolution open => fixed
01-05-13 23:22 nam Fixed in Version  => 4.0.34


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker