Page 1 of 1

Filename chekcing

Posted: Fri Jan 14, 2011 10:15 pm
by spacebiscuit
Hi guys,

I am trying to match file names which are a combination of numbers only, with a .php extension.

So far I have:

![0-9]+(.php)+!

But this is finding matches within a file names which might begin with a letter, such as: abc123.php

How can I disregard letters at the start of the filename?

Thanks in advance,

Rob.

Re: Filename chekcing

Posted: Sat Jan 22, 2011 9:45 pm
by fwycruiser118
/^[\d]+\.php/
Maybe what you are looking for is a circumflex anchor which enforces the name to begin with a number.
http://us2.php.net/manual/en/regexp.ref ... nchors.php