On 27 Mar 2006 10:09:41 -0800, Geoff <skhisma / gmail.com> wrote:
> Is there a way to concatenate regular expressions in ruby?  Something
> like Regexp.union but without the or between expressions.

Here's a little addition (bad pun) for the Regexp class:

  class Regexp
    def +(re)
      Regexp.new self.to_s + re.to_s
    end
  end

The #to_s method preserves option semantics.

andrew

-- 
Andrew L. Johnson   http://www.siaris.net/
      What have you done to the cat? It looks half-dead.
          -- Schroedinger's wife