My code was
if(eregi($pattern,$file)){
$out['file'][]=$file;
}else
But is doesn't work in php 5.3, it shows the alert
Function eregi() is deprecated
so I changed to
if(preg_match($pattern,$file)){
$out['file'][]=$file;
}else
But now it shows
preg_match(): No ending delimiter '.' found
Did I enter any wrong syntax?