Range pattern match : Range include « Range « Ruby






Range pattern match


  while line = gets
    puts line if line =~ /start/ .. line =~ /end/
  end

  while gets
    print if /start/../end/
  end

 








Related examples in the same category

1.Test if something is included in the set of objects specified by the range.
2.Being a lowercase letter
3.is an integer in a range
4.is an integer in an exclusive range
5.Check the range belongings
6.Range containability check