Hi,
I want to solve a problem using regex but somehow things won't work the way I want them to...
I have a text I'm extracting from a webpage e.g.:
<table>
<tr>
<td>Informations</td>
<td>Informations</td>
<td>Informations</td>
</tr>
<tr>
<td>Informations</td>
<td>Informations</td>
<td>Informations</td>
</tr>
</table>
I want to read the Informations into Variables using regex
As a first step I'm intending to read everything between the <tr> and </tr> tags into a variable
using the expression:
CODE(.*)(</tr>)[/CODE]
my problem is that php seems to look for the longest possible in this case it returns:
<tr>
<td>Informations</td>
<td>Informations</td>
<td>Informations</td>
</tr>
<tr>
<td>Informations</td>
<td>Informations</td>
<td>Informations</td>
</tr>
How can I specify to search for the very next ccurence of </tr> instead of the last?
I know there is this \G flag but I couldn't get it working