From the 1.4.6 "Rubybook" package for Linux: Ranges as Conditions As well as representing sequences, ranges may also be used as conditional expressions. For example, the following code fragment prints sets of lines from standard input, where the first line in each set contains the word ``start'' and the last line the word ``end.'' while gets print if /start/../end/ end I have tried this in combination with the IO.foreach class method to extract data from the middle of a log file as follows: IO.foreach('report.txt') do |line| if line =~ /START/../END/ # do stuff end end When I do this the loop skips everything ahead of the START tag (as expected), however the END tag is ignored. The only thing I can think of to explain this is the fact that =~ is designed to accept either a regex or a string... Could it be that using the range of regex in this case is resulting in a call to succ which is doing nothing? Help?!?