Home  >  Article  >  Backend Development  >  $result= ereg("d$" "1"); 回到什么

$result= ereg("d$" "1"); 回到什么

WBOY
WBOYOriginal
2016-06-13 13:21:32817browse

$result= ereg("^\d$", "1"); 返回什么
$result=   ereg( "^\d$ ",   "1 ");
我测出来是false;
  $result=   ereg( "^[0-9]$ ",   "1 ");  
测出来是true;
$result=   ereg( "^\.$ ",   ". ");
测出来是true;
真的有点不厚道了,我读了好几遍正则了,\d代表数字啊.真是想不通,高手说一下.

------解决方案--------------------
注: 使用 Perl 兼容正则表达式语法的 preg_match() 函数通常是比 ereg() 更快的替代方案。

不知道你可惜什么?

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