Paddy3118 schrieb:
> On Jan 29, 10:14 pm, Wolfgang N?dasi-Donner <won... / donnerweb.de>
>> irb(main):001:0> md="abba".match(/(?<a1>.)(?<a2>.)\k<a2>\k<a1>/)
> Hi Wolfgang,
> I was going to ask why you did not use the syntax of (?P<name>...) as
> used in Python, but found that, according to http://www.amk.ca/python/
> howto/regex/regex.html#SECTION000530000000000000000, the P is for
> Python extensions.

It's not that easy. The regular expression engine used in Ruby 1.9 is not 
integral part or ruby. It is a stand alone regular expression engine called 
"Oniguruma" (http://www.geocities.jp/kosako3/oniguruma/).

Oniguruma is actually existent in tree variants, "2.x.y" can be used in Ruby 1.6 
and 1.8, but it is not the standard engine of Ruby 1.6/1.8, "4.x.y" will be used 
in Ruby 1.9ff, and "5.x.y" is not related to Ruby.

The syntax of the regular expressions are not defined by Ruby, they are defined 
by Oniguruma.

Wolfgang N?dasi-Donner