Eero Saynatkari wrote:
> On 2006.10.22 10:02, Giles Bowkett wrote:
>> Anybody know a way to make this DRYer?
>>
>>    when /^([A-Za-z0-9,]+), '([^']+)', '([^']+)', '([^']+)'/
> 
> \1, \2 etc. may be used to refer to previous numbered groups.

Which does not help in this case because that makes it match the same 
stuff again:

irb(main):031:0> %w{aaa abc bcd}.map {|s| /(\w)\1\1/ =~ s}
=> [0, nil, nil]

Other suggestions

when /^([A-Za-z0-9,]+)((?:, '([^']+)'){3})/
   # and then apply a second match to group 2

when /^([A-Za-z0-9,]+)#{", '([^']+)'" * 3}/o

irb(main):032:0> /^([A-Za-z0-9,]+)#{", '([^']+)'" * 3}/o
=> /^([A-Za-z0-9,]+), '([^']+)', '([^']+)', '([^']+)'/

Kind regards

	robert