2009/8/21 Pascal J. Bourguignon <pjb / informatimago.com>:
> Joao Silva <rubyforum / thisisnotmyrealemail.com> writes:
>
>> Fleck Jean-Julien wrote:
>>> 2009/8/21 Joao Silva <rubyforum / thisisnotmyrealemail.com>:
>>>>
>>>> How i can convert this proper way?
>>>
>>> Try without the quotes
>>>
>>>>> Regexp.new(/regexp/i)
>>> => /regexp/i
>>>
>>> Cheers,
>>
>> I cannot do this without quotes - i need get it from string. Only thing
>> i have is "/regexp/i" string.
>
> string="/regexp/i"
> Regexp.new(eval(string))

"Regexp.new" is superfluous:

irb(main):002:0> eval("/regexp/i").class
=> Regexp
irb(main):003:0>

Cheers

robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/