func init // add using module sys.add_use('System.Text.RegularExpressions') // initialize properties if(linked("NextMatch") and linked("doNextMatch")) sys.add_var(this.name, 'Match') end end func make_match(data) return(d("Match") + '.NextMatch()') end func doNextMatch(data) if(linked("Match")) if(linked("NextMatch")) blk.println(this.codename, ' = ', make_match(data), ';') event("onNextMatch", this.codename) else event("onNextMatch", make_match(data)) end end end func NextMatch if(linked("doNextMatch")) return(this.codename) else return(make_match()) end end