From: Ari Brown Date: 2007-09-29T12:19:15+09:00 Subject: Re: regex: capture groups and term binding On Sep 28, 2007, at 7:43 AM, Simon Mullis wrote: > Hi Peter, Hi Simon and Peter > class Regexp > def +(other) > if other.is_a?(Regexp) > if self.options == other.options > Regexp.new(source + other.source, options) > else > Regexp.new(source + other.to_s, options) > end > else > Regexp.new(source + Regexp.escape(other.to_s), options) > end > end > end This is also exactly (mostly) what is implemented the the aw3s0m3 (sic) library, TextualRegexp. And let me say, DAMN Regexp.+ makes life easier :-D ---------------------------------------------------------------| ~Ari "I don't suffer from insanity. I enjoy every minute of it" --1337est man alive