Check lines in file matches regular expression pattern.