Find the letter 'z' within three characters after an 'a'
Riffing on @Shepmaster's excellent answer:

def nearby_az(string)
  !!string.match(/a.{,2}z/)
end

['baz', 'abz', 'abcz'].each do |s|
  puts "nearby_az('#{s}') expect true: #{nearby_az(s)}"
end
['a', 'z', 'za'].each do |s|
  puts "nearby_az('#{s}') expect false: #{nearby_az(s)}"
end