Ste*_*goo 1 php regex preg-match
朋友们,我正赶往最后期限,我认为这会让我做出幼稚的错误.这里我有验证需要正则表达式,每次我输入有效表达式preg_match返回false.现在很久我想要发现错误,但我不能!我用Google搜索和AFAICS,事情似乎没问题请帮我发现错误.谢谢,斯特凡诺
<?php
$string = "37961/T.08";//valid ID, it is supposed to match
$regex = '/^[0-9]{5,}/[a-zA-Z]\.[0-9]{2,}/';
if (preg_match($regex, $string)) {
echo 'matched expression!';
} else {
echo 'unmatched expression pattern';//comes here instead of valid regex!
}
?>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
70 次 |
| 最近记录: |