made each_scan_match more universally usable