From: Robert Klemme Date: 2009-10-27T22:04:08+09:00 Subject: Re: RCR: regex + regex 2009/10/26 Roger Pack : >> What might be the corresponding * or - behaviors? It seems like >>   a * b >> is closer to >>   /(a)*(b)/ > > > That's what I'd guess for *, as well. > >> than anything else I could think of and that immediately implies: >>   a + b >> becomes: >>   /(a)+(b)/ >> rather than just /(a)(b)/ >> >> The fact that + is a meaningful character in a Regexp makes a >> universal meaning for it as an operation *on* regexps a bit ambiguous. > > Yeah, or what | > means or what not.  I'd probably just stick with concatenation and not > even *define* *. You are aware that you can use string interpolation in regular expressions, do you? irb(main):001:0> a=/foo/ => /foo/ irb(main):002:0> b=/bar/ => /bar/ irb(main):003:0> x=/#{a}#{b}/ => /(?-mix:foo)(?-mix:bar)/ Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/