From: Christian Neukirchen Date: 2005-07-31T04:29:42+09:00 Subject: Re: [Brainstorming Input] Ruby-Oniguruma interoperability on Named Groups "Wolfgang N�dasi-Donner" writes: > In detail a regular expression that consists only of a named group > definition (starts with '(?') kann be registered by something > like 'Regex.register(/(?a|b|c|d)/)', and be deleted by > Regex.remove(''). If the regular expression is assigned to a > variable this can be used, how to manage this in the 'remove' case has > to be clearified. I used class methods for this example, but it may be > better to introduce a named Regexp objects which will be created by > something like '/(?a|b|c|d)/.create. Some possibility for > explicit deletion should be there, because the regex engine Oniguruma > must know about the object to take care about. > > These Object can later on be referenced in regular expressions by > \k' or '\g' as if they were defined there. Can't we do that already? example = /a|b|c|d/ mybigregex = /#{example}|foo/ If you need more scope, use constants. > Wolfgang N�dasi-Donner -- Christian Neukirchen http://chneukirchen.org