Sebastian Hungerecker wrote in post #1134556:
> On 27.01.2014 16:38, Arup Rakshit wrote:
>> Can you explain the below 3 outputs below :
>>
>> a = "hello there"
>>
>> a[/[aeiou](.)\1/, 0]   #=> "ell"
>> a[/[aeiou](.)\1/, 1]   #=> "l"
>> a[/[aeiou](.)\1/, 2]   #=> nil
>
> The regex /[aeiou](.)\1/ matches the substring "ell". Specifically
> [aeiou]
> matches the "e", the dot matches the "l" and \1 matches the second "l".
>

Thank you very much! I got it now fully..

-- 
Posted via http://www.ruby-forum.com/.