improved regexes to sanitize dockerfiles for building