#! ruby -Ku require "kconv" def check(str) if /G.+G/ =~ str then print(Kconv.tosjis("○") + str + "\n") else print(Kconv.tosjis("×") + str + "\n") end end print(Kconv.tosjis("「G.+G」にマッチするかどうか\n\n")) check("GooG") check("GomaG") check("G1234321G") check("Gpp\nopoG")