new RegExp('str', 'i'); // 字符串模式 new RegExp(/str/, 'i'); // regular expression literal 模式
let reg = "a"; "abcdefg".replace(new RegExp(reg,"gm"), "qwe") //输出 qwebcdefg