📅  最后修改于: 2022-03-11 15:04:07.499000             🧑  作者: Mango
// strip anything other than digits, (), -+/* and .
var str = "12/5*9+9.4*2".replace(/[^-()\d/*+.]/g, '');
alert(eval(str));