---
title: "js使用正则表达式判断是否为汉字"
author: "j2ee_yohn"
date: "2009-06-05T00:53:19Z"
tags: ["JavaScript", "正则表达式"]
slug: "js"
draft: false
lastmod: "2009-06-05T00:53:19Z"
id: 402244
url: "https://j2ee-yohn.iteye.com/blog/402244"
---

&lt;script&gt;  
     alert(/^\[\\u4E00-\\u9FA5]$/.test("啰"));1

    alert(/^\[^\\x00-\\xff]$/.test("沒")); 2  
&lt;/script&gt;