#! ruby -Ku require "kconv" def check(str) if /入門/u =~ str then print(Kconv.tosjis("○" + str + "\n")) else print(Kconv.tosjis("×" + str + "\n")) end end print(Kconv.tosjis("「入門」にマッチするかどうか\n\n")) check("栽培入門") check("入門口座") check("入試時期")