private static boolean matchClass(char classIdentifier, char c) {
        boolean res;
        char lowerClassIdentifier = Character.toLowerCase(classIdentifier);
        switch (lowerClassIdentifier) {
        case 'a': res = Character.isLowerCase(c) || Character.isUpperCase(c); break;
        case 'c': res = isControl(c); break;
        case 'd': res = Character.isDigit(c); break;
        case 'l': res = Character.isLowerCase(c); break;
        case 'p': res = isPunct(c); break;
        case 's': res = isSpace(c); break;
        case 'u': res = Character.isUpperCase(c); break;
        case 'w': res = Character.isLowerCase(c) || Character.isUpperCase(c) || Character.isDigit(c); break;
        case 'x': res = isHex(c); break;
        case 'z': res = (c == 0); break;
        default: return (classIdentifier == c);
        }
        return (lowerClassIdentifier == classIdentifier) == res;
    }
Only works with non-negative numbers
main/src/main/java/cgeo/geocaching/wherigo/kahlua/stdlib/StringLib.java