Reply to Re: preg help

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация