From: Peter Szinek Date: 2006-04-06T23:08:18+09:00 Subject: Re: String generalization > cat gen1.rb; ruby gen1.rb > #!/usr/bin/env ruby > # > > class Generalize < Regexp > The only part i am missing is the one that gave me te most headache in the java version - the second step of generalization. Example: r = Generalize.new("a.b@c.d.e.f.g") You would return: \w+.\w+@\w+.\w+.\w+.\w+.\w+ (first step) But i want \w+.\w+@(\w+\.)+\w+ (second step) instead... i.e. to find the repeating strings in the pattern and + them. I mean it's ok to find the repeating strings, since you can do this with one back-referencing regexp. But to decide which of the repeating parts to + etc. is a real PITB... At least for me it was. bw, Peter