therealwesfoster Posted May 16, 2008 Share Posted May 16, 2008 My code: <?php $file = '<div class="body">my stuff</div>'; echo preg_match('/\<div class="body">(.\s*)\<\/div>/im',$file,$match); ?> I'm trying to match what is in between the <div> tags. I know how to match regularly, but there is a newline in-between the <div> tags. I can't figure out how the make it match that. Please help, Thanks Link to comment https://forums.phpfreaks.com/topic/105868-solved-urgent-regex-help-please/ Share on other sites More sharing options...
therealwesfoster Posted May 16, 2008 Author Share Posted May 16, 2008 Nevermind, i just got it. I added the /s modifier to the end. <?php $file = '<div class="body">my stuff</div>'; echo preg_match('/\<div class="body">(.*)\<\/div>/ism',$file,$match); ?> Link to comment https://forums.phpfreaks.com/topic/105868-solved-urgent-regex-help-please/#findComment-542573 Share on other sites More sharing options...
phpSensei Posted May 16, 2008 Share Posted May 16, 2008 Your in the wrong forum anyways. Link to comment https://forums.phpfreaks.com/topic/105868-solved-urgent-regex-help-please/#findComment-542576 Share on other sites More sharing options...
trq Posted May 16, 2008 Share Posted May 16, 2008 Thanks for hitting the solved button. Link to comment https://forums.phpfreaks.com/topic/105868-solved-urgent-regex-help-please/#findComment-542586 Share on other sites More sharing options...
therealwesfoster Posted May 16, 2008 Author Share Posted May 16, 2008 Thanks for the sarcasm. gosh, what happened to these forums Link to comment https://forums.phpfreaks.com/topic/105868-solved-urgent-regex-help-please/#findComment-542588 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.