class_docstr: :param string: The input string.
  :param re_matches: List of (compiled_re_pattern, re_match) tuples.
  :param group_names_to_nodes: Dictionary mapping all the re group names to the matching Node instances.
docstr: Get the `MatchVariable` instance, representing trailing input, if there is any.
  "Trailing input" is input at the end that does not match the grammar anymore, but
  when this is removed from the end of the input, the input would be a valid string.
docstr_tok: ["Get","the","`","MatchVariable","`","instance",",","representing","trailing","input",",","if","there","is","any",".","``","Trailing","input","''","is","input","at","the","end","that","does","not","match","the","grammar","anymore",",","but","when","this","is","removed","from","the","end","of","the","input",",","the","input","would","be","a","valid","string","."]
code: def trailing_input(self):
      """
      Get the `MatchVariable` instance, representing trailing input, if there is any.
      "Trailing input" is input at the end that does not match the grammar anymore, but
      when this is removed from the end of the input, the input would be a valid string.
      """
      slices = []
  
      # Find all regex group for the name _INVALID_TRAILING_INPUT.
      for r, re_match in self._re_matches:
          for group_name, group_index in r.groupindex.items():
              if group_name == _INVALID_TRAILING_INPUT:
                  slices.append(re_match.regs[group_index])
  
      # Take the smallest part. (Smaller trailing text means that a larger input has
      # been matched, so that is better.)
      if slices:
          slice = [max(i[0] for i in slices), max(i[1] for i in slices)]
          value = self.string[slice[0] : slice[1]]
          return MatchVariable("<trailing_input>", value, slice)
  
imports: from __future__ import unicode_literals
  import re
  from six.moves import range
  from .regex_parser import Any, Sequence, Regex, Variable, Repeat, Lookahead
  from .regex_parser import parse_regex, tokenize_regex
label_desc: Use image node_id 6 for calling the Match obj's underlying member method code with example usage: obj.trailing_input() and returns: MatchVariable