hey guys how do i capture this value 23:03 using regular expression, from a code like this <div style="float: left; width: 70px;"> 23:03<br> </div> if it was all on the same line it would be no problem but the line breaks are whats throwing me off. if it was a single line like so <div style="float: left; width: 70px;">23:03<br></div> then i would use this preg_match_all("/<div style=\"float: left; width: 70px;\">(.*)<br></div>/",$,$); any ideas will be greatly appreciated thanks
$subject =<<<AAA <div style="float: left; width: 70px;"> 21:01<br> </div> <div style="float: left; width: 70px;"> 22:02<br> </div> <div style="float: left; width: 70px;"> 23:03<br> </div> AAA; preg_match_all('%<div\sstyle="float:\s*left;\s*width:\s*70px;">\s*(\d\d:\d\d)\s*<br>\s*</div>%simx', $subject, $result, PREG_PATTERN_ORDER); foreach ($result[1] as $time) { echo "$time\n"; } PHP: