Hi and happy easter to everyone,

Its time to do some Ruby programming. However, I stumbled on the following
problem. Can anyone explain the behavior:

def cr(b,d,e)
/^(#{b}(#{d})?#{e})|((#{b})?#{d}(#{e})?)/
end

# Why does
puts ("be" =~ cr("b", "d", "e"))

# match when
puts ("1e1" =~ cr('(\d(_*\d+)*)', '(\.\d(_*\d+)*)', '((e|E)-?(_*\d+)+)'))

# doesn't?

Regards,

Agnot


______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup