<pre><code class="js">x.match(/^[\u4E00-\u9FA5]+$/) // 检测<a href="/tag/zhongwen/" target="_blank" class="keywords">中文</a>
x.match(/^[a-zA-Z]+$/) // 检测英文
<pre><code class="js">x.match(/^[\u4E00-\u9FA5]+$/) // 检测<a href="/tag/zhongwen/" target="_blank" class="keywords">中文</a>
x.match(/^[a-zA-Z]+$/) // 检测英文