2012/6/8 Jan E. <lists / ruby-forum.com>:
> "Iaki Baz Castillo" <ibc / aliax.net> wrote in post #1063634:
>> 2012/6/7 cyber c. <lists / ruby-forum.com>:
>> Regexp.new(/^([a-zA-Z]+)(.+)$/).match(str).captures
>
> Why are you using Regexp.new, when /^([a-zA-Z]+)(.+)$/ already *is* a
> Regexp? This seems nonsensical to me, like String.new("abc").

Yes, I'm used to store my regexps in some module/class constants and
usually use Regexp.new for some reason I don't remember right now,
maybe because it allows passing a string which is useful in certain
cases:

Regexp.new("^([a-zA-Z]+)(.+)$")

But right, in my previous code I was passing a Regexp instance to
Regexp.new, which is not cool, sure :)

-- 
Iaki Baz Castillo
<ibc / aliax.net>