#! ruby -Ku require "kconv" def check(str) if /a.+b/ =~ str then print(Kconv.tosjis("○") + str + "(" + $& + ")" + "\n") else print(Kconv.tosjis("×") + str + "\n") end end print(Kconv.tosjis("「a.+b」にマッチするかどうか\n\n")) check("00a11b22b33b44")