If requested, limit search length.
Limit regex search for BEGIN to the first 4K of the file.