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 Quote 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]. Quote 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!!!!! Quote Link to comment https://forums.phpfreaks.com/topic/196393-everything-in-between/#findComment-1031175 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.