Js replace replaces all matched strings



var s="abachdas";
var s2=s.replace(new RegExp(/(a)/),'b');//Replace all the a's in s with b's