const lookbehind = "abcbc".replace(/(?<=a)b/g, "0"); const lookahead = "ababc".replace(/b(?=c)/g, "0"); console.log(lookbehind, lookahead); // a0cbc aba0c
正则,look ahead,look behind,regex
相关文章: