0

Suppose string is <a href=&#039;fooo&#039; >hai</a><img src=&#039;foo&#039; >hai&#039;b

i want to remove all &#039; in between src/href

So the result should be like this

<a href=fooo>hai</a><img src=foo>hai&#039;b

It should effect only the tags <a><img>

1 Answers1

2
<a\K|\G(?!^)[^>]*?\K&#039;|<img\K|\G(?!^)[^>]*?\K&#039;

Try this.Replace by empty string.See demo.

https://www.regex101.com/r/rG7gX4/8

vks
  • 67,027
  • 10
  • 91
  • 124