From: James Britt Date: 2007-01-13T09:51:47+09:00 Subject: Re: DRY gsub... Gregory Seidman wrote: > > Cleaned up: The whole point was *not* to clean it up, but to make obvious what and why something was happening in the code. Brevity is the soul of wit, but it can play havoc with code maintenance. > > DELIMITERS = Regexp.new([ > " ", > "\r\n", > ";", > "," > ].map{ |c| Regexp.escape(c) }.join("|")) > > a = d.split(DELIMITERS) > Unless these chunks of code are right next to each other, it may be hard to know the purpose for the delimiters or what's driving the split. -- James Britt