#!/usr/koeki/bin/ruby print("シリーズ:STYLE・PRIME・SMART・PRO\n\n") print("特徴:防水・イルミネーション・カメラ・スリム・Wオープン・ 海外(世界)でも使える・タッチパネル・ヨコモーション・スタミナバッテリー・ シンプル・ワンセグ・カラー・ビジネス・大画面・スマートフォン・薄型\n\n") print("色:ピンク・ブラック・ホワイト・パープル・ゴールド・ラベンダー ブルー・シルバー・チェリー・ブラウン・グリーン\n\n") STDERR.print"携帯電話に求めるものは?:" pattern = STDIN.gets.chomp! request = Regexp.new(pattern, true ,"e") open("telephone.dat","r") do |denwa| while telephone = denwa.gets if request =~ telephone if/(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/ =~ telephone printf("\nおすすめする携帯電話は %sシリーズの %s です。 %s! 詳しくはサイト内の %s をクリック!\n",$2,$1,$3,$1) end end end end