ArrayScanner that mimics Ruby's std lib StringScanner