How to replace image url

Hello Developer,
I am trying to replace my current image src by another src.
here is my current image src <p><img src="blob:https://hessd.csb.app/4b4be139-c300-45b8-ae38-3f55bc530602"></p><react-component count="" editable="true"></react-component><p> </p>
I want to replace it by another link , here is what I have implemented
editor .getHTML() .match(/<img [^>]*src="[^"]*"[^>]*>/gm) .map((x) => x.replace(/.*src="${response.data?.imageUrl}".*/, "$1") );
response.data?.imageUrl is coming from my REST API result. and editor.getHTML() return HTML code.

Do you have a link to the site/code of what you are trying to accomplish?