|
Posted by Justin Koivisto on 10/13/05 16:00
system7designs@gmail.com wrote:
> I don't know preg's that well, can anyone tell me how to write a
> regular expression that will select everything BUT files/folders that
> begin with ._ or __?(that's period-underscore and underscore
> underscore)
>
if(!preg_match('`^(\._|__)`',$filename)){
// filename does not start with "._" or "__"
}
You don't need regular expressions for this, as you could do something like:
$s=substr($filename,0,2);
if($s!='._' && $s!='__'){
// filename does not start with "._" or "__"
}
--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com
Navigation:
[Reply to this message]
|