From: Lance Pollard Date: 2009-09-01T15:27:36+09:00 Subject: Re: Best Practice for Multiline Regexps Thanks a lot Robert for your help. > Which Tokenizer are you referring to? Can you give more detail about > your patterns or the kind of replacement you want to do? I would like to be able to do code generation in a kind of preprocessor way for Actionscript, but I don't want to use a preprocessor because it seems like too much work (especially in actionscript or java), and I'd have to do pattern matching anyway :). For example, I'd like to convert this: [Bindable] public function get myProperty():String { return _myProperty; } public function set myProperty(value:String):void { _myProperty = value; } ... or this: [Bindable] public var myProperty:String; ... or anything in between (different formatting...), to this: [Bindable(event="myPropertyChange")] public function get myProperty():String { return _myProperty; } public function set myProperty(value:String):void { _myProperty = value; dispatchEvent(new Event("myPropertyChange")); } .... That accessor little snippet can be from 1 to 20+ lines, and I'd like to be able to just add that line in there without having to run through the file a bunch of times. There's a few other examples similar to that that I'd like to do to, but that's the gist of it. Lance -- Posted via http://www.ruby-forum.com/.