PHP preg_match(): Compilation failed: PCRE does not support

开发中在使用preg_match()验证中文正则报错

解决方法:

/^[\x80-\xff]{6,30}$/ 

代替  

/^[\u4e00-\u9fa5]{2,32}$/

 

具体原理,参考:https://blog.csdn.net/u013101178/article/details/82756550

posted @ 2021-08-12 20:21  coder_xds  阅读(311)  评论(0编辑  收藏  举报