Improved the check for non-ascii characters in the headers.
Used Posix regular expression groups.