specify ranges of characters inside the square brackets
# This scan matches all lowercase letters between a and m. "This is a test".scan(/[a-m]/) { |x| puts x }