From: Jeff Myers Date: 2010-09-15T04:16:36+09:00 Subject: beginner's q about eval and/or code blocks This ruby program successfully prints all 5-letter words starting with 'j' (in a text file containing all current U.S. English Scrabble words). fp = File.open('C:\Documents and Settings\User\twl06FromMac.txt') fp.each do |line| puts line if line =~ /^j....$/ end I would like to allow the user to enter the regex rather than have it hard-coded as above. I've tried to get eval to work after building a string to pass it. No luck so far. I'm positive this is easy in Ruby but currently it's driving me nuts. -- Posted via http://www.ruby-forum.com/.