From: Andrew Johnson Date: 2006-03-28T03:38:55+09:00 Subject: Re: Concatenation of regular expressions On 27 Mar 2006 10:09:41 -0800, Geoff 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