func init // add using namespaces sys.add_use('System.Text.RegularExpressions') // initialize properties if(sys.is_linked(3) and linked("doMatches")) sys.add_var(this.name, 'MatchCollection') end this.setfield('ex', 'ex' + this.id) end func make_matches(data) dt = d("Data") exp = d("Expression") op = d("Options") return('Regex.Matches(' + dt + ', ' + exp + ((len(op) and op != 'null') ? (', ' + op) : '') + ')') end func doMatches(data) linked("onError") ? blk.println('try {').inc() : '' if(sys.is_linked(3)) blk.println(this.codename, ' = ', make_matches(data), ';') event("onMatches", this.codename) else event("onMatches", make_matches(data)) end if(linked("onError")) blk.dec().println('} catch(ArgumentException ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func Matches if(linked("doMatches")) return(this.codename) else return(make_matches()) end end func Count if(linked("doMatches")) return(this.codename + '.Count') else return(make_matches() + '.Count') end end func IsReadOnly if(linked("doMatches")) return(this.codename + '.IsReadOnly') else return(make_matches() + '.IsReadOnly') end end func IsSynchronized if(linked("doMatches")) return(this.codename + '.IsSynchronized') else return(make_matches() + '.IsSynchronized') end end func SyncRoot if(linked("doMatches")) return(this.codename + '.SyncRoot') else return(make_matches() + '.SyncRoot') end end