Styles2304 Posted July 2, 2008 Share Posted July 2, 2008 I'm trying to preg_match this bit of text (that changes regularly): <div class="pad2020"> The LORD thy God in the midst of thee [is] mighty; he will save, he will rejoice over thee with joy; he will rest in his love, he will joy over thee with singing. </div> if I do: '/<div class=\"pad2020\">(.*?)<\/div>/'; The array returns empty. I'm still very much a baby when it comes to regex so thanks for any help that I get. Quote Link to comment https://forums.phpfreaks.com/topic/112937-solved-quick-question-preg_matchcarriage-returns/ Share on other sites More sharing options...
rhodesa Posted July 2, 2008 Share Posted July 2, 2008 to for a '.' to match new lines, you need to add an 's' modifier (and you don't need to escape the quotes): '/<div class="pad2020">(.*?)<\/div>/s'; Quote Link to comment https://forums.phpfreaks.com/topic/112937-solved-quick-question-preg_matchcarriage-returns/#findComment-580129 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.