ES6
正则表达式
let str='asdfde we fsadfas weAr efAf'; alert(str.replace(/a/gi, '*'));
将所有的a用*代替,忽略大小写
← match 换行 →