func init // add using namespaces sys.add_use('System.Text.RegularExpressions') // initialize properties if(sys.is_linked(3) and linked("doMatch")) sys.add_var(this.name, 'Match') end this.setfield('ex', 'ex' + this.id) end func make_match(data) dt = d("Data") exp = d("Expression") op = d("Options") return('Regex.Match(' + dt + ', ' + exp + ((len(op) and op != 'null') ? (', ' + op) : '') + ')') end func doMatch(data) linked("onError") ? blk.println('try {').inc() : '' if(sys.is_linked(3)) blk.println(this.codename, ' = ', make_match(data), ';') event("onMatch", this.codename) else event("onMatch", make_match(data)) end if(linked("onError")) blk.dec().println('} catch(ArgumentException ', this.ex, ') {').inc() event("onError", this.ex + '.Message') blk.dec().println('}') end end func Match if(linked("doMatch")) return(this.codename) else return(make_match()) end end func Value if(linked("doMatch")) return(this.codename + '.Value') else return(make_match() + '.Value') end end func Captures if(linked("doMatch")) return(this.codename + '.Captures') else return(make_match() + '.Captures') end end func Empty return('Match.Empty') end func Groups if(linked("doMatch")) return(this.codename + '.Groups') else return(make_match() + '.Groups') end end func Index if(linked("doMatch")) return(this.codename + '.Index') else return(make_match() + '.Index') end end func Length if(linked("doMatch")) return(this.codename + '.Length') else return(make_match() + '.Length') end end func Success if(linked("doMatch")) return(this.codename + '.Success') else return(make_match() + '.Success') end end