From: matz@... (Yukihiro Matsumoto) Date: 2002-07-03T02:15:42+09:00 Subject: Re: grep regex to ruby regex... Hi, In message "grep regex to ruby regex..." on 02/07/03, Todd Holloway writes: |I'm just about to finish up my first ruby program, but I'm |stuck on one last part...I need equivlent of the below in ruby: | |grep -v "^[[:space:]]*#" filename | grep -v '^[[:space:]]*$' File.foreach(filename) do |line| next if /^\s*#/ =~ line next if /^\s*$/ =~ line print line end matz.