I am trying to match all tags except for tags inside textareas that have the "data-do-not-match-this='true'" attribute. Given I have this test string:
<textarea>{{one}}{{two}}</textarea>
<textarea data-do-not-match-this="true">{{three}}{{four}}</textarea>
<textarea>
{{five}}
{{six}}{{seven}}
</textarea>
<textarea data-do-not-match-this="true">
{{eight}}
{{nine}}{{ten}}
</textarea>
{{eleven}}{{twelve}}
I have this regex so far:
(?<!data\-do\-not\-match\-this="true">)({{.*?}})
The regex incorrectly matches {{four}}, {{eight}}, {{nine}}, and {{ten}}. How can I fix the regex to exclude tags I do not want to match?
This is my Rubular: