I have this html code :
<div>
<a href="TOTO/{{CODE}}/TOTO/{{CLICK}}/{{OPEN}}" data-href="TOTO/{{CODE}}/TOTO/{{CLICK}}/{{OPEN}}">FOO1</a>
</div>
<div>
<a href="{{CODE}}/{{CLICK}}/BAR" data-href="{{CODE}}/{{CLICK}}/BAR">FOO2</a>
</div>
and i would like to change {{CODE}} by %%CODE%% and {{CLICK}} by %%CLICK%% and {{OPEN}} by %%OPEN%%, but only in the attributes data-href in all of div.
I do not know how to target only data-href. I tried this to target brackets in data-href attribute :
/data-href="([^"]+)({{([^\"]*)}}+)([^"]+)"/g
But it doesn't work !
Thanks for your help.