Some Regex Help?
I'm trying to check to make sure a variable equals something like the following:
(number)(possible number)(possible number).jpg
So, for example: 1.jpg would work, 20.jpg would work, 101.jpg would work...but 10000.jpg or something.txt wouldn't work.
Here's my code, which is returning the following error:
PHP Code:
if(preg_match('^[1-9][1-9]?[1-9]?\(.jpg)$',$src)){ echo "yeah!";} else{ echo "no!";}
Code:
Warning: preg_match(): No ending delimiter '^' found in /home/content/a/l/e/alexjewell/html/clients/quinn/regexImg.php on line 5
Any ideas?
Thanks
Thou com'st in such a questionable shape
Hamlet, Act 1, Scene 4
Bookmarks