The example of this article tells JS Simple regular verification of Chinese characters in English and underline the method. Share to everyone for your reference, specific as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en"
"http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd ">
Verify that the nickname is Chinese, English, numeric, or underlined, and is 1 to 10 in length.
PS: Here again for you to provide 2 very convenient regular expression tools for your reference to use:
JavaScript Regular expression online test tool:
Http://tools.jb51.net/regex/javascript
Regular expression online generation tool:
Http://tools.jb51.net/regex/create_reg
More readers interested in JavaScript-related content can view this site: "JavaScript Regular expression Skills encyclopedia", "javascript replacement Operation Tips Summary", "JavaScript Search Algorithm Skills summary", " JavaScript data structure and algorithm skills summary, JavaScript traversal algorithm and tips summary, JavaScript JSON operation tips Summary, javascript error and debugging skills summary and JavaScript mathematical calculation of usage summary 》
I hope this article will help you with JavaScript programming.