var patrn = /^([\u4e00-\u9fa5]|[a-zA-Z0-9]|_){3,10}$/; var param = 'xxxx' if (!patrn.exec(param)) { //调用exec方法匹配 }