isPrintable function
Returns true if str contains only printable ASCII, tab, newline
or carriage return.
Unlike isAscii, control characters such as \x00 are rejected, and the
empty string passes.
Implementation
bool isPrintable(String str) => printableReg.hasMatch(str);