I have anchor tags in my html. The value of href
attribute starts with either '
or "
. I want to replace javascript:window.location.replace('
href value and ')
.
sample_input
"<a href="xyz.com" attr="pqrs"> text </a> \n <a href='xyz1.com' attr="pqrs"> text1 </a>"
desired_output
"<a href="javascript:window.location.replace('xyz.com')" attr="pqrs"> text </a> \n <a href='"xyz.com"' attr="pqrs"> text1 </a>"