JS收集<4>:限制输入搜索串

限制:2到30个字母、数字、中文

if(!/^[a-zA-Z0-9"u4e00-"u9fa5]{2,20}$/.test(av.value))
{
alert('error');
}

原文地址:https://www.cnblogs.com/lixx/p/1299813.html