#17 Match only first N characters on each line fix
(cherry picked from commit 64848e5)