From: Robert Klemme Date: 2003-10-09T18:12:16+09:00 Subject: Re: Extension Language for a Text Editor "Nikolai Weibull" schrieb im Newsbeitrag news:20031008200623.GC2178@puritan.bredbandsbolaget.se... Since others have commented on various aspects of your posting I'll only throw my 2c at this: > Also, is there any way of redefining the // operator for constructing > regular expression objects? I'm planning on implementing a new regex > syntax for the editor (to make searches/substitutions easier to > describe). Why do you want to change it? I find it quite flexible and expressive (especially when using flag "x"). And especially if you want to attract rubyists to use TREC (The Ruby Editor to Come), then you should ensure that their knowledge of ruby regexps is not obsoleted, since rx's will likely play an important role in user defined extensions! You can always define methods in Kernel like this: irb(main):002:0* module Kernel irb(main):003:1> def rx(str) irb(main):004:2> puts "building rx from '#{str}'" irb(main):005:2> end irb(main):006:1> end => nil irb(main):007:0> irb(main):008:0* rx %q{(foo)+ \s+ (\w+)} building rx from '(foo)+ \s+ (\w+)' => nil irb(main):009:0> rx '(foo)+ \s+ (\w+)' building rx from '(foo)+ \s+ (\w+)' => nil irb(main):010:0> Which isn't too bad IMHO. Regards robert