#! ruby -Ku require "kconv" def check(str) if /Go?gle/ =~ str then print(Kconv.tosjis("○") + str + "\n") else print(Kconv.tosjis("×") + str + "\n") end end print(Kconv.tosjis("「Go?gle」にマッチするかどうか\n\n")) check("Ggle") check("Gogle") check("Google") check("Goooooogle") check("Gmgle") check("Gomogle")