Home > Backend Development > PHP Tutorial > preg_match("^[-u4e00-u9fa5w]+$","哈哈11122") 报错

preg_match("^[-u4e00-u9fa5w]+$","哈哈11122") 报错

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:28:44
Original
1380 people have browsed it

<code>preg_match("^[-\u4e00-\u9fa5\w]+$","哈哈11122")  报错

preg_match(): No ending delimiter '^' found</code>
Copy after login
Copy after login

回复内容:

<code>preg_match("^[-\u4e00-\u9fa5\w]+$","哈哈11122")  报错

preg_match(): No ending delimiter '^' found</code>
Copy after login
Copy after login

preg_match("/^([\x{4e00}-\x{9fa5}]+)\w+$/u","哈哈11122",$match) ;
var_dump($match);
array(2) {
  [0]=>
  string(11) "哈哈11122"
  [1]=>
  string(6) "哈哈"
}
Copy after login

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template