正则表达式判断字符串是汉字还是拼音

function checkFormat(str)
{
if (escape(str).indexOf("%u")!=-1)
alert("不能含有汉字");      
else if(str.match(/\D/)!=null)
{
  alert('不能含有字母');
}
}
..
原文地址:https://www.cnblogs.com/lanyueer/p/2118623.html