仅字母数字字符和 - / 的正则表达式

Regular Expression for Alphanumeric characters and - / only

尝试处理 javascript 中允许字母数字字符的正则表达式排除大多数唯一字符,除了 - /

validateDesc: function(desc) {
    var matches = /^[a-zA-Z\d\-_.,\s]+$/;
    return matches.test(desc);
}

上面的那个我试过只允许字母数字,我必须添加什么才能做到这一点?如果有人能就如何添加其他独特字符提供任何见解,我们将不胜感激。

正则表达式需要分隔符。如果您希望匹配,请务必包含 /

validateDesc: function(desc) {
  var matches = /^[a-zA-Z0-9\-_., \t\/]+$/;
  return matches.test(desc);
}