I am facing a requirement to only allow (extended) ASCII characters in my input. As a solution, I've implemented a JavaScript regex pattern like this:
/^[\x20-\xff]+$/.test("helloê¿£×جáƒ")
However, this doesn't work as expected. Interestingly, when I remove the function sign (159 in extended ASCII), it works fine. This is perplexing because characters like á (160) and × (158) are accepted, indicating that some extended ASCII characters are being allowed.
It seems like there might be something obvious that I'm overlooking here, but what could it be?