Possible Duplicate:
RegEx match open tags except XHTML self-contained tags
I'm stuck in weird regex problem, I'm parsing some HTML table in PHP.
RegEx I'm using : <td[^>]*>(h.*?)</td>
<td>other data</td> <td>other data</td><td>Data_needed</td> <td>--</td>
but its matching all other data too.
Now I want to match it to <td>Data_needed</td> <td>--</td>
I tried some regular expressions which gives output like
other data</td> <td>other data</td><td>Data_needed</td> <td>--
starting from first <td>
to last </td>
but I want Data_needed
from <td>Data_needed</td> <td>--</td>