markvaughn2006 Posted March 24, 2010 Share Posted March 24, 2010 Hello, i know this is probably pretty simple but still very new to regex stuff... how would i go about retreiving - 0.008025 from this <span class="sg"> <span id="ref_73025_l">0.008025</span> so actually i would need to get everything in between '<span class="sg"><span id="ref_*">' and '</span>' the 73025_1 would be changing (sometimes 4,5,or 6 characters long)so I would need to wildcard that part somehow... and capturing the result in a variable? thanks!!!!!!!! :D :D Link to comment https://forums.phpfreaks.com/topic/196393-everything-in-between/ Share on other sites More sharing options...
premiso Posted March 24, 2010 Share Posted March 24, 2010 preg_match('~<span id="ref_.*">(.*)</span>~isU', $string, $matches); Should get you want you want. Result will be in $matches[1]. Link to comment https://forums.phpfreaks.com/topic/196393-everything-in-between/#findComment-1031171 Share on other sites More sharing options...
markvaughn2006 Posted March 24, 2010 Author Share Posted March 24, 2010 you are fricking awesome, thx!!!!! Link to comment https://forums.phpfreaks.com/topic/196393-everything-in-between/#findComment-1031175 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.