From: matz@... (Yukihiro Matsumoto) Date: 2001-05-30T00:06:50+09:00 Subject: [ruby-talk:15932] Re: Regexp (a\1) Hi, In message "[ruby-talk:15924] Re: Regexp (a\1)" on 01/05/29, ts writes: |Y> * backreferences corresponding to unclosed/unmatched parentheses |Y> should fail always. | | This is not what do perl, and this will be a difference from perl/ruby. | | For perl a reference exist only *after* it has found the close ')' | ruby .... *when* ...... open '(' Hmm, I don't get the point. | This mean that perl can re-use a previous backreference, for example this | is valid in perl | | "aaaaaa" =~ /^(a\1?)(a\1?)(a\2?)(a\3?)$/ | | and it must give the result $1 = "a", $2 = "aa", $3 = "a", $4 = "aa" (this | is extract from the tests of perl). Ruby gives same result (before and after the modification). Probably I'm missing something. matz.