Thank you for the comment, more examples added. Let me know if have concrete problems with running particular expressions.
There is an example of /e among the examples. The implementation is straightforward, substituting \X with 5!:5 and Do the result. Thus quotes are treated as expected. '/([^ ]+) ([^ ]+)/\2,''-'',\1/e' rxs 'q''123 z456' z456-q'123 The escapement of \\ is incorporated in the definition. There are interesting things that you can discover reading the code. For example, multiple /e would result in multiple execution: '/([^ ]+) ([^ ]+)/\2,''-'',\1/ee' rxs '123 456' 333 > From: Raul Miller <[EMAIL PROTECTED]> > > On Tue, Oct 21, 2008 at 3:51 PM, Oleg Kobchenko wrote: > > http://www.jsoftware.com/jwiki/Scripts/Regular_Expressions_Substitution > ... > > Maybe anybody would have some suggestions in the process. > > If you support /e (which I think would be nice), then some examples > would be nice. > > /e would imply a j expression for the result pattern, which would be > evaluated to get the result string. I am wondering, for example, if > \1 would result in a quoted string, in this context -- or, if not, how > I would handle patterns which matched apostrophes. > > -- > Raul > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
