static class FRegExp extends FunctionImpl { static boolean debug; String re; *(String *re) {} public O process(Object _in) { String in = cast _in; Matcher matcher = Pattern.compile(re).matcher(in); boolean found = matcher.find(); if (debug) debug("found: " + found + ", regexp: " + re); if (found) return matcher.group(1); else return ""; } public void toJava_process(Code code) { code.line("Matcher m = Pattern.compile(" + javaQuote(re) + ").matcher(" + code.s() + ");"); code.assign("m.find() ? m.group(1) : \"\""); } }