static bool ctxEvalPattern(S pat) { ret ctxEvalPattern(pat, ctxContext().input); } static bool ctxEvalPattern(S pat, S input) { if (empty(pat)) true; CtxContext c = ctxContext(); WoodyBot bot = woodyBot(); Pattern p = null; if (bot != null) p = bot.compiledPatterns.get(pat); if (p == null) { S pat2 = ctxExpandMacros(pat, c.regexpMacros); S re = ctxREToJavaRE(pat2); p = Pattern.compile(re, Pattern.CASE_INSENSITIVE); } if (bot != null) bot.compiledPatterns.put(pat, p); ret p.matcher(input).find(); }