📜  正则表达式“通配符”占位符 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:29.753000             🧑  作者: Mango

代码示例1
// To match "cat", "BAT", "fAT", "mat"
const regexWithWildcard = /.at/gi;
const testString = "cat BAT cupcake fAT mat dog";
const allMatchingWords = testString.match(regexWithWildcard); // ["cat", "BAT", "fAT", "mat"]