I need help in creating this regex for replacing the text
Heres the sample input:
<variable class="loves">[loves] My dog loves dog food </variable>
Heres the sample output i am expecting:
<variable class="loves">[loves] My dog hates dog food </variable>
Thank you
The regex i am currently using highlights the word loves written in square brackets as well as outside the square bracket. I want to ignore the word loves written in square bracket
- I am using this regex -
(?<=variable.*>.*)loves(?=.*<\/variable)