Hello people,
i have a small problem with regex...
1. I have a string which contains HTML code of some Table Rows in this format:
<tr id="systemhalfTableRow_(A|B)[NUMBER]">...dynamic content...</tr>
Now i need to remove this table row from the string with all the other rows in it.
2. Lets say this is my string with my rows
$tableRows = '<tr id="systemhalfTableRow_A1"><td>Hello</td></tr>
<tr id="systemhalfTableRow_B12"><td>Hello</td></tr>
<tr id="systemhalfTableRow_A2"><td>Hello</td></tr>';
3. I want to delete the rows with the id A from 1 to 2
for($i = 1; $i <= 2; $i++) {
$id = 'systemhalfTableRow_A' . $i;
preg_replace(PATTERN, '', $tableRows);
}
4. What should remain after that?
<tr id="systemhalfTableRow_B12"><td>Hello</td></tr>
I would like to use PREG
Please helf me with this one
Thank you!
greetings,
paolo