Does the "Lexical Class" function do what you need. It outputs a numeric code as follows:
0=Extended characters with a Command- or Option- key prefix (codes 128 through 255)
1=Non-displayable ASCII characters (codes 0 to 31 excluding 9 through 13)
2=White space characters: Space, Tab, Carriage Return, Form Feed, Newline, and Vertical Tab
3=Digits 0 through 9
4=Uppercase characters A through Z
5=Lowercase characters a through z
6=All printable ASCII non-alphanumeric characters
Mike..