I want to add a string {something} to a string if it contains href=" or href='.
Note - There could be space around the =.
So, if my input is <a href="http://google.com">Click</a>
The output should be <a href="{something}http://google.com">Click</a>
So far, I have this regular expression which matches with what I want to match, but don't know how to add the string after the matching part.
/href\s*=\s*(\"|\')/
I checked need help with regex in javascript to replace string pattern