0

The following code should be able to find a match but it does not. Online Regular Expression Test sites are able do find a match. Try for instance on http://www.regexplanet.com/advanced/php/index.html. What is wrong with my code?

<?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.";
    }
?>

Result:

A match was not found

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

BBB
  • 61
  • 7

0 Answers0