Home >Backend Development >PHP Tutorial >一个PHP匹配的有关问题

一个PHP匹配的有关问题

WBOY
WBOYOriginal
2016-06-13 10:05:58906browse

一个PHP匹配的问题
case   en_cn:
return   preg_match( "/^[a-z\u4E00-\u9FA5]{8,20}$/ ",$str);
break;

上面是匹配中文和英文组合的字符串   且长度为8到20   但是是在PHP里面运行报如下错误
Compilation   failed:   PCRE   does   not   support   \L,   \l,   \N,   \U,   or   \u

------解决方案--------------------
http://www.isnono.com/read.php/14.htm
------解决方案--------------------
preg_match( "/^[a-z\x4E00-\x9FA5]{8,20}$/ ",$str);

Statement:
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