greedy preg

From: Date: Wed, 06 Aug 2003 21:16:23 +0000
Subject: greedy preg
Groups: php.general 
Request: Send a blank email to php-general+get-158563@lists.php.net to get a copy of this message
$contents = preg_replace( "|<item>.*?$file.*?</item>|si", "", $contents ); it's being run on an XML file, where each entry is <item>......</item> with a $file pointer in there. it works okay, except for the fact that it deletes that record, and every record before it. i can't figure out why it's being greedy? i know i gotta be missing something real simple...

« previous php.general (#158563) next »