code: function getIndicesOfCaptures(inputString, matchedArray) {
    var currIndex;
  
    if (matchedArray) {
      currIndex = matchedArray.index; //index of first regex match
      if (matchedArray[0] === inputString) matchedArray = matchedArray.slice(1);
      return matchedArray.map(function(v) {
        var index = inputString.indexOf(v, currIndex);
        currIndex += v.length;
        return index;
      });
    }
    else return void 0;
  }
docs: /*
  gets the indices of where the capture groups matched in the
  source string
  type RegexCapturesArray = Array
  getIndicesOfCaptures :: String -> RegexCapturesArray -> Array
   
  Get the indices where capture groups have matched
  @param  {String} inputString   Untouched input string
  @param  {Array} matchedArray   Array that is a result of running a regexp on input string
  @return {Array}                Array of indices of capture groups