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 Quote 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); ?> Quote 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. Quote 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. Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.