I am trying to replace all occurrences of http://xyz.yzx.com/abc/def/
by /qwe/
in String
in Node js. I am very new to Node js. So, I think I am doing some mistake in syntax. Following is the code with which I am trying.
var newString = originalString.replace("http:\/\/xyz\.yzx\.com\/abc\/def\//g", "/qwe/");
But this is not doing any replace. Can someone suggest what I am doing wrong? I have tried lot of tweaks but somehow I am not able to achieve the replace all occurrences.
Any suggestions you can give would be really appreciated.