📅  最后修改于: 2022-03-11 15:00:44.003000             🧑  作者: Mango
var regex = new RegExp("^[A-Za-z0-9? ,_-]+$");
var key = String.fromCharCode(event.charCode ? event.which : event.charCode);
if (!regex.test(key)) {
event.preventDefault();
return false;
}