Home > Backend Development > PHP Tutorial > Regular expression verification Chinese

Regular expression verification Chinese

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-29 08:55:29
Original
1119 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:
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
Latest Issues
Ajax submit script submission error
From 1970-01-01 08:00:00
0
0
0
How to use the created hook in the setup script
From 1970-01-01 08:00:00
0
0
0
javascript - script tag async attribute
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template