sbool ctxEvalPattern_debug; 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); if (ctxEvalPattern_debug) print("Java RE pattern: " + re); p = Pattern.compile(re, Pattern.CASE_INSENSITIVE); } if (bot != null) bot.compiledPatterns.put(pat, p); Matcher m = p.matcher(unnull(input)); if (m.find()) { c.matches.add(m.group()); true; } false; }