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.
class_docstr_tok: [":","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: Return a list of (varname, reg) tuples.
docstr_tok: ["Return","a","list","of","(","varname",",","reg",")","tuples","."]
code: def _nodes_to_regs(self) -> list[tuple[str, tuple[int, int]]]:
      """
      Return a list of (varname, reg) tuples.
      """
  
      def get_tuples() -> Iterable[tuple[str, tuple[int, int]]]:
          for r, re_match in self._re_matches:
              for group_name, group_index in r.groupindex.items():
                  if group_name != _INVALID_TRAILING_INPUT:
                      regs = re_match.regs
                      reg = regs[group_index]
                      node = self._group_names_to_nodes[group_name]
                      yield (node, reg)
  
      return list(get_tuples())
  
imports: from __future__ import annotations
  import re
  from typing import Callable, Dict, Iterable, Iterator, Pattern
  from typing import Match
  from .regex_parser import AnyNode, Lookahead, Node, NodeSequence, Regex, Repeat, Variable, parse_regex, tokenize_regex
label_desc: Use image node_id 2 for calling the Match obj's underlying member method code with example usage: obj._nodes_to_regs() and returns: list