http://pl.php.net/manual/en/function.glob.phpCytat
glob's regex does not offer any kind of quantification of a specified character or character class or alternation. For instance, if you have the following files:
a.php
aa.php
aaa.php
ab.php
abc.php
b.php
bc.php
with pcre regex you can do ~^a+\.php$~ to return
a.php
aa.php
aaa.php
This is not possible with glob. If you are trying to do something like this, you can first narrow it down with glob, and then get exact matches with a full flavored regex engine. For example, if you wanted all of the php files in the previous list that only have one or more 'a' in it, you can do this:
<?php
$list = glob("a*.php");
foreach ($list as $l) {
if (preg_match("~^a+\.php$~",$file))
$files[] = $l;
}
?>