JS username, Chinese, double-byte, string contains Zhong Wenjing expression

Source: Internet
Author: User
Tags regular expression trim

Web page effects username, Chinese, double-byte, string containing Zhong Wenjing expression
<!doctype HTML public "-//W3C//DTD XHTML 1.0 transitional//en" "http:// Www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd "
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312"/>
<title> Web effects user name, Chinese, double-byte, string contains Zhong Wenjing expression </title>
<script language= "Web Effects"
//english;
function Isenglish (s) {
 s = trim (s);
 var p =/^[a-za-z]+$/;
 return p.test (s);
}
//Chinese;
function Ischinese (s) {
 s = trim (s);
 var p =/^[u0391-uffe5]+$/;
 return p.test (s);
}
//Double-byte
function Isdoublechar (s) {
 var p =/^[^x00-xff]+$/;
 return p.test (s);
}
//contains Chinese characters
function Haschinesechar (s) {
 var p =/[^x00-xff]/;
 return p.test (s);
}
</script>

<body>
<!--Here we provide several common validation functions, with user name regular expression, validation Zhong Wenjing expression, double-byte regular expression, validation string containing Zhong Wenjing expression;
</body>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.