Why is this regular expression not working?

edmundnewyork

New Member
Content of 1.txt:\[code\]Image" href="http://stackoverflow.com/questions/3732143/images/product_images/original_images/9961_1.jpg" rel="disable-zoom:false; disable-expand: false"><img src="http://stackoverflow.com/questions/3732143/im\[/code\]Code that does not work:\[code\]<?php$pattern = '/(images\/product_images\/original_images\/)(.*)(\.jpg)/i';$result = file_get_contents("1.txt");preg_match($pattern,$result,$match);echo "<h3>Preg_match Pattern test:</h3><br><br><pre>";print_r($match);echo "</pre>";?>\[/code\]I expect this result:\[code\]Array( [0] => images/product_images/original_images/9961_1.jpg [1] => images/product_images/original_images/ [2] => 9961_1 [3] => .jpg)\[/code\]But i take this-like:\[code\]Array( [0] => images/product_images/original_images/9961_1.jpg" rel="disable-zoom:false; disable-expand: false"> [1] => images/product_images/original_images/ [2] => 9961_1.jpg" rel="disable-zoom:false; disable-expand: false"> )\[/code\]I'n tired of trying from a million combinations of this regexp. I dunno what's wrong. Please and thanks a lot!
 
Top