[ad_1]
I have a piece of HTML markup, for which I need to add a specific CSS rule to it. The HTML is like this:
<tr>
<td style="color:#555555;padding-top: 3px;padding-bottom: 20px;">In order to stop receiving similar emails, simply remove the relevant <a href="https://domain.tld/dashboard/" target="_blank">saved search</a> from your account.</td>
</tr>
As you can see td
already contains a style
tag, so my idea is to match the last ;
of it and replace it with a ;
plus the rule I need to add…
The problem is that, although I used the appropriate non-capturing group, I still can’t figure out how to do this properly… Take a look at this experiment please: https://regex101.com/r/qlVq6A/1
On the other hand, when I assign a capturing group to the last part (the text in English that’s there just to identify which td
I’m interested in) it works OK, but I feel like this is an indirect way to make this work… Take a look at this experiment: https://regex101.com/r/qhVatN/1
Can someone explain to me why the first route doesn’t work? Basically, why the non-capturing group still captures the text inside of it…
[ad_2]