<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.