#!/usr/koeki/bin/ruby print "検索パターン: " pattern = STDIN.gets.chomp! regexp = Regexp.new(pattern, nil, "e") while line=gets if regexp =~ line print line end end