On 17.01.2009 09:10, George George wrote: > Thank you so much for all the replies. Here is a simple benchmark for > Brian and Jesus approaches. I Run it on ubuntu 8.04, 1GB RAM, 2 CPUs > 3.40GHz. > > .... > .. > require 'benchmark' > Benchmark.bm do |bm| > > bm.report("Brian:") do > expand_seq "t[ac][tc]aaattaag[ga]gaag[ac]ttggtgga" do |seq| > #puts seq > end > end > > bm.report("Jesus:") do > /t[ac][tc]aaattaag[ga]gaag[ac]ttggtgga/.generate > end > end > > ser system total real > Brian: 0.000000 0.000000 0.000000 ( 0.000642) > Jesus: 0.000000 0.000000 0.000000 ( 0.003574) You probably need to execute each variant in a loop multiple times to get meaningful results. Kind regards robert -- remember.guy do |as, often| as.you_can - without end