while s = gets s = s.chomp.split case s[0] when "digi" s = s[1..-1].join.downcase if s =~ /nyo[^a-zA-Z0-9]{0,3}$/ puts "CORRECT (maybe)" else puts "WRONG!" end when "petit" s = s[1..-1].join.downcase if s =~ /nyu[^a-zA-Z0-9]{0,3}$/ puts "CORRECT (maybe)" else puts "WRONG!" end when "rabi" s = s[1..-1].join.downcase if s =~ /[a-zA-Z0-9].*$/ puts "CORRECT (maybe)" else puts "WRONG!" end when "gema" s = s[1..-1].join.downcase if s =~ /gema[^a-zA-Z0-9]{0,3}$/ puts "CORRECT (maybe)" else puts "WRONG!" end when "piyo" s = s[1..-1].join.downcase if s =~ /pyo[^a-zA-Z0-9]{0,3}$/ puts "CORRECT (maybe)" else puts "WRONG!" end else puts "WRONG!" end end