Hello Community, i want to replace a word love with hates in a multi line,
The regex that i use:
(?<=>.*)(?<!\w)loves(?!\w)(?=.*<)
Input samples:
<p>hello i am human,
loves dogs.
</p> - highlights loves in 2nd line
<p>hello i am human,
loves dogs.</p> - highlights loves in 2nd line
<h1>loves dsdfsf</h1> -highlight loves
<h2>fdsfsd loves </h1> -highlight loves
<h3>dloves</h3> - ignore
<li> loves</li> -highlight loves
<li>loves </li> -highlight loves
<variable>lovesd</variable> - ignore lovesd
<h2 class="loves">loves</h2> - ignore the loves in within <h2 class="loves">,