From: Boson Date: 2008-04-10T23:05:05+09:00 Subject: Re: Regexp.union - set option all patterns case insensitive Chris Shea wrote: > I don't know how much better this is, but you could union first, then > add the case-insensitivity: > > fruits = ["apples","oranges","grapes"] > r = Regexp.union(*fruits) > r = Regexp.new(r.source, Regexp::IGNORECASE) # => /apples|oranges| > grapes/i This solution works. Thanks. Looking at the Ruby source, it wouldn't be hard to add an options parameter to Regexp.union to avoid such re-conversions.