而咖啡脚本版本的史蒂文·彭尼的答案,因为这是2谷歌结果…即使咖啡只是删除了很多字符的javascript…;)
baz = "foo" filter = new RegExp(baz + "d") "food fight".match(filter)[0] // food
在我的特殊情况下
robot.name=hubot filter = new RegExp(robot.name) if msg.match.input.match(filter) console.log "True!"