I single qouted your directories and replaced you '\\' with / to avoid the unicode error0 out of 4 - c:/win32app/toolkit - regexp value : 1 out of 4 - c:/winnt - regexp value : 2 out of 4 - C:/WINNT/system32 - regexp value : 3 out of 4 - d:/perl - regexp value : 4 out of 4 - d:/brossad - regexp value :
my @bannedF = ('c:/win32app/toolkit', 'c:/winnt', 'C:/WINNT/system32', 'd:/perl', 'd:/brossad'); my $folder = 'c:/TEMP/sdfs'; for (0..$#bannedF) { return BANNED if ($folder eq $bannedF[$_]); # if folder is directly equal to a banned folder if ($mode == INC_SUBDIRS) # if a parent folder is banned then so are the subfolders unle +ss otherwise stated { $folder =~ /^($bannedF[$_]).*/; print "$_ out of $#bannedF - $bannedF[$_] - regexp value : $1 +\n"; return BANNED if ($1); # example : $folder = c:\temp\one; $bannedF[$_] = c:\temp } }
In reply to Re: Reg Ex : an odd error...
by bear0053
in thread Reg Ex : an odd error...
by Foggy Bottoms
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |