Nobuyoshi Nakada
6/5/2007 11:02:00 AM
Hi,
At Tue, 5 Jun 2007 18:55:02 +0900,
Morgan Cheng wrote in [ruby-talk:254395]:
> Say, I want to get all files in one folder. Since Dir.entries will
> have "." and ".." included. I want to strip them out with "grep". I
> tried to write in such a way as I can did similarly in Perl:
> log_files = Dir.entries(log_dir).grep(!/^\.\.?/)
grep(/\A(?!\.\.?\z)/)
--
Nobu Nakada