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 = compileRegexpIC(re); } if (bot != null) bot.compiledPatterns.put(pat, p); Matcher m = p.matcher(unnull(input)); //ctxContext().matches.clear(); if (m.find()) { S group = m.group(); //print("Setting MATCH1=" + group); listPut(c.matches, 0, group); true; } false; }