private static int pushCaptures(MatchState ms, StringPointer s, StringPointer e ) {
        int nlevels = ( ms.level == 0 && s != null ) ? 1 : ms.level;
        BaseLib.luaAssert(nlevels <= LUA_MAXCAPTURES, "too many captures");
        for (int i = 0; i < nlevels; i++) {
            pushOnecapture(ms, i, s, e);
        }
        return nlevels;  // number of strings pushed
    }
Only works with non-negative numbers
main/src/main/java/cgeo/geocaching/wherigo/kahlua/stdlib/StringLib.java