Page 1 of 1

express problem

Posted: Tue Mar 04, 2008 5:07 am
by itsmani1
Hi want to fetch:
<font style="font-weight:bold;">Chicago Cubs</font> <br/>

vs

<br />
Milwaukee Brewers

Here is my code.

Code: Select all

            $title = '/<div class="listevent">(.*) <\/div>/';
            preg_match_all($title, $value, $mat);
It returns me empty array, any help

Code: Select all

<div class="list1">
    <div class="listevent"><font style="font-weight:bold;">Chicago Cubs</font> <br/>
    
        vs 
    
      <br />
      Milwaukee Brewers</div>
    <div class="listdate">March 4, 2008<br/>1:05 pm<br />
      <!--Tuesday, 7:05 pm--></div>
 
    <div class="listvenue">
        <strong>Hohokam Park</strong><br />
     Mesa, AZ         </div>

Re: express problem

Posted: Tue Mar 04, 2008 8:36 pm
by HCBen
You're close. You also need to add the appropriate modifiers.

Code: Select all

#<div class="listevent">(.*?)<\/div>#ism
Prost!
Ben