my regex flaw exposes another?

Kezdőlap
Csatolmányok:
Üzenet email-ben
+ (text/plain)
Üzenet törlése
Válasz az üzenetre
Szerző: Kevin Buettner
Dátum:  
Tárgy: 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