code: function(attr) {
        var startIndex, endIndex,
          i = 0,
          hasEndBracket = true,
          indices = [];
        startIndex = attr.indexOf('[', i);
        while (startIndex > 0 && hasEndBracket) {
           endIndex = attr.indexOf(']', i);
           indices.push(parseInt(attr.substring(startIndex + 1, endIndex), 10));
           i = endIndex + 1;
           hasEndBracket = i > 0;
           startIndex = attr.indexOf('[', i);
        }
        return indices;
      }
docs: Gets the indices out of an attr name: foo[0][1] -> [0, 1] and foo[2] -> [2]