# encoding: utf-8 require 'conv_ja_char/version' module ConvJaChar class CharTypeCheck def self.kanji?(str) return nil unless str regexp_kanji = /[一-龠々]+/ str =~ regexp_kanji # nil: not match, not nil: the position number that the matched char starts end def self.symbol?(str) return nil unless str regexp_symbol = /[!"#%&()*+,.\/:;<=>?@^_`{|}~]+/ # without white space, dollar sign($), single quotation(') and hyphen(-) str =~ regexp_symbol # nil: not match, not nil: the position number that the matched char starts end end end