function parser(optionsExp) {
    var match;

    if (! (match = optionsExp.match(NG_OPTIONS_REGEXP))) {
      throw 'ng-options parse error';
    }

    var 
        displayFn = match[2] || match[1],
        valueName = match[4] || match[6],
        keyName = match[5],
        groupByFn = match[3] || '',
        valueFn = match[2] ? match[1] : valueName,
        valuesFn = match[7],
        track = match[8],
        trackFn = track ? match[8] : null;

    var ngRepeat;
    if (keyName === undefined) { // array
      ngRepeat = valueName + ' in ' + valuesFn;
      if (track !== undefined) {
        ngRepeat += ' track by '+trackFn;
      }
    } else { // object
      ngRepeat = '('+keyName+', '+valueName+') in '+valuesFn;
    }
    
    // group not supported yet
    return {
      ngRepeat: ngRepeat,
      locals: {
        valueName: valueName,
        keyName: keyName,
        valueFn: valueFn,
        displayFn: displayFn
      }
    };
  }
editableNgOptionsParser

see: https://github.com/angular/angular.js/blob/master/src/ng/directive/select.js#L131