It could give a false positive if every byte of a 'binary' file happened to contain the code of an ASCII character. (Can you tolerate an extremely rare error?)
I know only one binary file that intentionally contains only ASCII characters: The EICAR test file. Here it is, in its full glory:
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
It is a DOS executable that just prints the embedded text "EICAR-STANDARD-ANTIVIRUS-TEST-FILE!" and then exits.
Alexander
In reply to Re^2: Question regarding a regex
by afoken
in thread Question regarding a regex
by CrashBlossom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |