A little redo to work with Ruby's... interesting... way of handling regex match groups if you want both offset and content.

Example: line.to_enum(:scan,/#{pattern}/i).map { |m,| [$`.size, $`.size+m.length,m] }

The syntax highlighting isn't perfect on this one as I'm redesigning the routine.