Ulric Gress
Hi Peter, Regular Labs
I'm trying to use DB-Replacer in collaboration with ChatGPT, and it's actually working really well. However, there's one simple thing it can't generate a regex for, and that's this code:
<div id="block" class="product grid">
<div class="product-item">
<div><img src="images/produkter/fixbrik/Fixbrik-4mm-hvid.png" alt="Knudsen Kilens hvide Fixbrik 4mm" /></div>
</div>
<p>Knudsen Fixbrik is a spacer suitable for all types of tasks where items need to be stabilized, such as door and window installation, kitchen and bathroom element setup, skirting boards, panels, etc.</p>
<p><img src="images/Miljo/epd-danmark.png" alt="EPD" width="300" height="226" style="display: block; margin-left: auto; margin-right: auto;" /></p>
</div>
The two free `<p>` elements inside `<div id="block" class="product grid">` need to be targeted and wrapped in a clean `<div>`, which should then be placed inside a `<div class="product-caption">`.
It should look like this:
<div id="block" class="product grid">
<div class="product-item">
<div><img src="images/produkter/fixbrik/Fixbrik-4mm-hvid.png" alt="Knudsen Kilens hvide Fixbrik 4mm" /></div>
</div>
<div class="product-caption">
<div><p>Knudsen Fixbrik is a spacer suitable for all types of tasks where items need to be stabilized, such as door and window installation, kitchen and bathroom element setup, skirting boards, panels, etc.</p>
<p><img src="images/Miljo/epd-danmark.png" alt="EPD" width="300" height="226" style="display: block; margin-left: auto; margin-right: auto;" /></p>
</div>
</div>
</div>
The regex to target <p> it gives me is: `(<div id="block" class="product grid">)(.*?)(<p>.*?<\/p>)(.*?)(<\/div>) but it is not working.
I hope you can shed some light on this.
Best,
Ulric