日期:2014-05-16  浏览次数:20393 次

奇怪的正则表达式
下面的正则表达式表示的是什么

function test_name(str){ 
    var reg = /^[u4E00-u9FA5]+$/;
    if(!reg.test(str)){
     return false;
    }
    return true;

JavaScript 正则表达式

------解决方案--------------------
test_name(value) 返回true的是全部汉字
返回false 才是不是全部是汉字组成的

所以你提示的话应该用

f(!test_name(document.form.user_name.value)){