Q:

Regex Match Within Range

I need do a regex match for ASCII characters 32 - 90 inclusive.
I've attempted the following, however it doesn't seem to return anything.
preg_match("/^[\x20-\x5A]+$/u", $input)

The idea is that it is from hex 20 to hex 5a. I pulled these from http://www.asciitable.com/
I've got a spot for testing this on http://www.phpliveregex.com/p/2Dh

A:

Your current range only supports upper case letters, so you need the /i modifier:
$input = 'adddd ### AAAA????';
preg_match('/^[\x20-\x5A]+$/i', $input); // int(1)

Alternatively, add the extra letters in the range:
preg_match('/^[\x20-\x5A\x61-\x7A]+$/', $input))

