#! ruby -Ku require "kconv" def check(str) if /200[^a-zA-Z]/ =~ str then print(Kconv.tosjis("○") + str + "\n") else print(Kconv.tosjis("×") + str + "\n") end end print(Kconv.tosjis("200[^a-zA-Z] にマッチするかどうか\n\n")) check("200") check("2007") check("200!") check("200b") check("200A")