my regex flaw exposes another?

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: Kevin Buettner
日付:  
題目: my regex flaw exposes another?
On Mar 6, 4:04pm, Mike wrote:
> [...] I was trying to exclude
> both the ".", "..", and a directory called "approved".

[...]

> next if ($file =~ /(^\.)(approved)/);


Try:

    next if ($file =~ /^(\.\.?|approved)$/);


(Untested.)

Kevin