Regular expression verification Chinese

WBOY
Release: 2016-07-29 08:55:29
Original
1074 people have browsed it

<script></span></span></p> <span><span>var str="China";</span><br><span>var reg=/^[u4e00-u9fa5]{0,}$/;</span><br></span><p><span><span>if(reg.exec (str))</span></span><span>{</span></p> <p><span><span>alert('with Chinese');</span></span></p> <p><span><span><span>}</span></span></span><span>else{</span></p> <p><span><span>alert('without Chinese ');</span></span> </p> <p><span><span>}</span></span></p> <span><span></script>

The above has introduced regular expression verification in Chinese, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template