ainoy31 Posted February 5, 2008 Share Posted February 5, 2008 Hello- I have the following data I need to extract from. Status:</font></span></td> <td align="left" style="height: 18px; font-weight: normal; font-size: 10pt;"> <span id="FormView1_pro_stageLabel" wrap="false" style="display:inline-block;"><font face="Arial,Helvetica,Microsoft Sans Serif" color="#000040" size="2">DELIVERED - 12/28/2007</font></span></td> I am only trying to get the word DELIVERED out of the html tags. Also, there could be another word or two about the status. This one just happens to be DELIVERED. So, here is my code I am trying to capture it. foreach(explode("\n",$data) as $line) { if(stristr($line, 'Status:')) { preg_match_all('#(Status):.*?(\w[a-zA-Z]/)#is', $data, $matches, PREG_SET_ORDER); print_r($matches); } } Much appreciation. AM Quote Link to comment Share on other sites More sharing options...
effigy Posted February 5, 2008 Share Posted February 5, 2008 This will work with the limited context given: /(?<=>)[A-Z\s]+(?=\s-\s\d)/ Quote Link to comment Share on other sites More sharing options...
ainoy31 Posted February 5, 2008 Author Share Posted February 5, 2008 Thank you for the suggestion. It is working. Quote Link to comment 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.