code: function matchInteger(text, startOffset) {
      let endOffset = startOffset
      let charCode = text.charCodeAt(endOffset)
      while (charCode >= 48 && charCode <= 57) {
          endOffset++
          charCode = text.charCodeAt(endOffset)
      }
  
      // No match, must return null to conform with the RegExp.prototype.exec signature
      if (endOffset === startOffset) {
          return null
      } else {
          const matchedString = text.substring(startOffset, endOffset)
          // according to the RegExp.prototype.exec API the first item in the returned array must be the whole matched string.
          return [matchedString]
      }
  }
docs: First lets define our custom pattern for matching an Integer Literal. This function's signature matches the RegExp.prototype.exec function. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec