PHP preg_match无法找到匹配项

时间:2016-01-22 13:47:23

标签: php regex

以下代码应该能够找到匹配但却没有。在线正则表达式测试站点能够找到匹配项。试试http://www.regexplanet.com/advanced/php/index.html。我的代码出了什么问题?

<?php
    if (preg_match("[a-zA-Z0-9]{1,200}\.[a-zA-Z0-9]{1,10}", "abc.jpg")) {
        echo "A match was found.";
    } else {
        echo "A match was not found.";
    }
?>

结果:

A match was not found

http://php.net/manual/en/function.preg-match.php

0 个答案:

没有答案