From: Emmanuel Oga Date: 2008-08-13T02:38:42+09:00 Subject: Re: what do you think of this code? >> 3. line 24 doesn't work '.' and '..' are not. How could I do that with >> regular expressions? > > not what? looks okay. I'm guessing maybe he used a regex like: if path =~ /..?/ but you need to escape the dots inside regexes if you want to catch the dot character if path =~ /\.\.?/ You will also need to check begin and end of the file name using the anchors: if path =~ /^\.\.?$/ Although I like regexes very much, maybe it is a bit overkill to use them in this case. path == "." || path == ".." looks good for this check. -- Emmanuel Oga ELC Technologies (TM) 1921 State Street Santa Barbara, CA 93101 eoga@elctech.com (866)863-7365 Tel (866)893-1902 Fax +44 (0) 20 7504 1346 Tel - London Office +44 (0) 20 7504 1347 Fax - London Office http://www.elctech.com