I am looking for ways to match a range of characters and assumed the following regEx would only match characters in the range of hex codes between 20 and 7E. However, it also matches chr(10)
(line feed), in fact, the following prints "passed":
echo preg_match("/^[\x20-\x7E]*$/", chr(10)) ? 'passed' : 'failed';
Any idea why and how to match that range?
chr(10) is end of line, so you should add modifier D.