I have the following text:
<p>k</p><p><span class="placeholder" code="{YSZZ}">Samsung xyz</span> </p>
<p>khgj <span class="placeholder" code="{UIDJU}">iPhone 9k</span> </p></div>
I want to replace the span tags with their respective code attribute. For that I'm using this pattern:
/<span class="placeholder" code="(.*?)">(?:.*)<\/span>/gi
But it's matching from the first span to the last, instead of each span individually. What am I missing?
https://regex101.com/r/fP4aD7/1
Thank you