# File lib/kwartz/util.rb, line 78 def pattern_to_regexp(pattern) i = 0 len = pattern.length s = '\A' while i < len case ch = pattern[i] when ?\\ ; s << Regexp.escape(pattern[i+=1].chr) when ?* ; s << '(.*)' when ?? ; s << '(.)' else ; s << Regexp.escape(ch.chr) end i += 1 end s << '\z' return Regexp.compile(s) end