From: gga Date: 2007-06-05T14:10:18+09:00 Subject: Re: Ruby problem with conditional ranges Sorry. Buggy code posted. Here's a correct implementation. #!/usr/bin/ruby -w ## one ## two ## three ## five ## six ## four ## five File.open($0) do |file| while file.gets if $_ =~ /^## two/ loop { print $_.sub(/^## /, '') file.gets break if not $_ or $_ =~ /^## four/ } end end end