Ok, since I've been trying to get this working forever, how wold you get something like this working I need, to get everything between these 2 tags:
<div class=Section1> and </div> Someone gave me this code: preg_match('!<div class=Section1[^>]+>(.*)</div>!Uis',$str,$regs); with the ! in front, and !Uis at the end, what does that mean? And when i try it with your script: preg_match('/.*<div class=Section1[^>]+>(.*)</div>.*/',$str,$regs); $good = $regs[1]; echo $good; I get: Warning: Unknown modifier 'd' in /home/victor/argilent-www/sites/malibu_place_2/main.php on line 197 197 is the preg_match code line. - Vic -----Original Message----- From: Bas Jobsen [mailto:[EMAIL PROTECTED]] Sent: Saturday, August 17, 2002 6:49 PM To: Jason Soza; PHP-General Subject: Re: [PHP] preg_match help? preg_match("/.*<b[^>]+>(.*)<font face=\"Verdana\" size=\"3\">.*/", $contents,$story); echo $story[1]; preg_match always return a array. The first element ($array[0])contains your complete regexp. The next ($array[1])one the first match between () etc. Don't use ! but / Op zondag 18 augustus 2002 01:27, schreef Jason Soza: > I seriously need some help trying to make a match here. Obligatory > disclaimer: yes, I've searched google.com, I've read the PHP manual section > on preg_match(), and I've sat here for 3 hours trying to resolve this on my > own. :) Any help would be great: > > I need to match everything between: > > <b>$headline > > Where $headline is a variable that will be filled out of a foreach() loop. > The pattern should return everything until it hits: > > <font face="Verdana" size="3"> > > The text file this is taken out of looks like: > > <font face="Verdana" size="3"><b>Headline here</b></font><p> > > News story, blah, blah, blah... > > <font face="Verdana" size="3"><b>Another headline</b></font><p> > > More news, blah, blah... > > ... > > The contents of the text file echo correctly before the preg_match, but the > preg_match I've tried: > > preg_match("!<b[^>]+>(.*)<font face=\"Verdana\" size=\"3\">!", $contents, > $story); > > Returns array(), so no matches are made. Any suggestions? > > TIA, > > Jason Soza -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ______________________________________________________________________ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php