private static boolean singleMatch ( char c, StringPointer p, StringPointer ep ) {
        switch ( p.getChar () ) {
        case '.':
            return true;  // matches any char
        case L_ESC:
            return matchClass ( p.getChar ( 1 ), c );
        case '[': {
            StringPointer sp = ep.getClone();
            sp.postIncrString ( -1 );
            return matchBracketClass ( c, p, sp );
        }
        default:
            return ( p.getChar () == c );
        }
    }
Only works with non-negative numbers
main/src/main/java/cgeo/geocaching/wherigo/kahlua/stdlib/StringLib.java