Range pattern match : Range include « Range « Ruby

Range pattern match

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

  while gets
    print if /start/../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