|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-09-26 15:38 UTC] 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
)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 15:00:02 2025 UTC |
sorry, expected result: Array ( [0] => "image.jpg" [1] => " [2] => image.jpg )