public Object[] getCaptures() {
            if (level <= 0) {
                return null;
            }
            Object[] caps = new String[level];
            for (int i = 0; i < level; i++) {
                if (capture[i].len == CAP_POSITION) {
                    caps[i] = new Double(src_init.length() - capture[i].init.length() + 1);
                } else {
                    caps[i] = capture[i].init.getString().substring(0, capture[i].len);
                }
            }
            return caps;
        }
Only works with non-negative numbers
main/src/main/java/cgeo/geocaching/wherigo/kahlua/stdlib/StringLib.java