how can i create a preg_match_all regex pattern for php to give me this code?
<td class="class2"> </td>
<td class="class2" align="right"><span class="DarkText">I WANT THIS TEXT</span></td>
To get me the text inside the span class?
thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use:
Then your text will be inside the first capture group (as seen on rubular)
With that out of the way, note that regex shouldn’t be used to parse HTML. You will be better off using an XML parser, unless it’s something really, really simple.