The regex pattern correctly identifies non-ASCII characters, but can be improved: The case-insensitive flag i is unnecessary for character ranges Consider using a more semantic variable name like NON_ASCII_RE -const ASCII_RE = /[^\x00-\x7F]/i; +const NON_ASCII_RE = /[^\x00-\x7F]/;...
Using the term "extended ASCII" on its own is sometimes criticized, because it can be mistakenly interpreted to mean that the ASCII standard has been updated to include more than 128 characters or that the term unambiguously identifies a single encoding, neither of which is the case. There ...