那么答案应该很简单。但我是正则表达式的新手。
我想做的只是查找和替换:
例如:iti$%#sa12c@#ombina#$tion.43of//.45simp5./l7e5andsp75e$%cial23$#of%charecters
将上述句子中的“of”替换为“in”
我试过这个但没有得到结果,请帮助我。
string="iti$%#sa12c@#ombina#$tion.43of//.45simp5./l7e5andsp75e$%cial23$#of%charecters";
var string2=string.replace("/(\w*\W*)of(\w*\W*)/g","$1in$2");
console.warn(string2);