Asheeown Posted March 15, 2009 Share Posted March 15, 2009 I have a string of HTML and I need to get everything in between <span class="q2"> and </span>, it happens multiple times throughout the string so I assumed the match_all function would work best? I've worked with php for over six years and never could figure out the search queries for preg_match. Quote Link to comment https://forums.phpfreaks.com/topic/149523-solved-preg_match_all/ Share on other sites More sharing options...
Psycho Posted March 15, 2009 Share Posted March 15, 2009 preg_match_all("|<span[^>]*>(.*)</span>|U", $text, $matches); Quote Link to comment https://forums.phpfreaks.com/topic/149523-solved-preg_match_all/#findComment-785260 Share on other sites More sharing options...
Asheeown Posted March 15, 2009 Author Share Posted March 15, 2009 Wow, thank you so much, that's exactly what I needed. Also, sorry for posting in the wrong forum, never saw that Regex subforum there before. Thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/149523-solved-preg_match_all/#findComment-785262 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.