I am writing this code to remove a string from 'a' to 'c'
var str = "abcbbabbabcd";
var re = new RegExp("a.*?c","gi");
str = str.replace(re,"");
console.log(str);
The result in the console is "bbd"
But the result that suits me is "bbabbd"
Can regex be used for this problem?
Thanks for the help.
source
share