PHP regular match between HTML content specified in the label wording
Assuming that the page reads as follows:
<table> <tr> <td></td> <td></td> </tr> <tr> <td></td> <td></td> </tr> </table>
I was content to be matched between each <tr> </ tr> (tr course, there are a lot of content, not listed here), not to consider tr nests problems.
Regular first thought is written like this:
preg_match_all( '/<tr[^>]*(.*?)<\/tr>/i', $string, $matches ); echo "<pre>"; print_r( $matches); echo '</pre>';
But can not run into the following through the Internet to search for information after writing to:
preg_match_all( '/<tr[^>]*([\s\S]*?)<\/tr>/i', $string, $matches ); echo "<pre>"; print_r( $matches); echo '</pre>';
The reason is simple, back and review on a regular expression shown in [.], [\ S] and [\ S] to know.