All of the instances of using $ to match end of string appear to be cases where a trailing newline should not be allowed, which $ allows. Either they are meant to match the end of a filename (e.g. for trailing slashes) where a trailing newline would actually mean it's not the end of a filename since newlines are valid in filenames; or it's already explicitly matching a CR/LF so has no reason to allow an additional LF. Each instance replaced with \z which only matches the end of the string.
Coverage increased (+1.8%) to 93.085% when pulling 0efe5c23a3f35e11119b275318b1690f7a86bfa5 on Grinnz:regex_end_of_string into 8f396aa8532ed6b017bea709016bd9e1dbe9a2a7 on dagolden:master.
All of the instances of using
$
to match end of string appear to be cases where a trailing newline should not be allowed, which$
allows. Either they are meant to match the end of a filename (e.g. for trailing slashes) where a trailing newline would actually mean it's not the end of a filename since newlines are valid in filenames; or it's already explicitly matching a CR/LF so has no reason to allow an additional LF. Each instance replaced with\z
which only matches the end of the string.