ID:               46184
 User updated by:  vasilkov80 at mail dot ru
 Reported By:      vasilkov80 at mail dot ru
 Status:           Open
 Bug Type:         *Regular Expressions
 Operating System: linux mandriva 2007
 PHP Version:      5.2.6
 New Comment:

sorry, expected result:

Array
(
    [0] => "image.jpg"
    [1] => "
    [2] => image.jpg
)


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

[2008-09-26 15:38:24] vasilkov80 at mail dot ru

Description:
------------
a problem with internal vars?

/\"([^\"]+\.jpg)\"/ - the pattern works fine...
/([\"\'])([^\\1]+\.jpg)\\1/ - a bit more complex pattern doesn't work
as expected!

Reproduce code:
---------------
if( preg_match("%([\"\']{1})([^\\1]+\.jpg)\\1%", '.. "bla bla
"image.jpg" .. " bla bla', $matches) )
        print_r($matches);

Expected result:
----------------
Array
(
    [0] => "image.jpg"
    [1] => image.jpg
)

Actual result:
--------------
Array
(
    [0] => "bla bla "image.jpg"
    [1] => "
    [2] => bla bla "image.jpg
)


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=46184&edit=1

Reply via email to