From: RichardOnRails Date: 2009-11-13T15:00:09+09:00 Subject: Re: DRYing a Regex On Nov 12, 7:37 pm, Caleb Clausen wrote: > On 11/12/09, James Edward Gray II wrote: > > > Well, you don't really need a StringScanner for this simple task.  Your code > > really just rebuilds String#scan(): > > >   a_new_list = s_new_list.scan(/[A-Z]+/) > > ooh! that's even better. You're right. I didn't NEED to DRY that simple thing. I'm just trying to improve my coding generally, especially to write things that don't break easily when the inevitable changes are made. But cutting out 90% of the code, wow! That's DRY!! Thank you very much for your ideas. I haven't tested it yet, but it looks right to me. Best wishes, Richard