var a = /\bd+ (pig|cow|cko)\b/ console.log(a.test("15 pig") //true
管道 - 正则表达式
原文:https://www.cnblogs.com/yuyedaocao/p/12044160.html