code: def get_matching_indexes(self, idx_spec):
          
          # if index is missing, assume to open the first HDU we know how
          # to do something with
          if idx_spec is None or idx_spec == '':
              idx, hdu = self.find_first_good_hdu()
              return [idx]
  
          match = re.match(r'^\[(.+)\]$', idx_spec)
          if not match:
              return []
  
          idx_spec = match.group(1).strip()
          if ',' in idx_spec:
              name, extver = idx_spec.split(',')
              name, extver = name.strip(), extver.strip()
          else:
              name, extver = idx_spec.strip(), None
  
          name = name.upper()
  
          if extver is None:
              if re.match(r'^\d+$', name):
                  # index just names a single HDU by number
                  return [int(name)]
  
              # <-- assume name is an HDU name and extver is 1
              extver = '1'
  
          # find all HDU's matching the name and extver
          idx_lst = []
          idx = 0
          for info in self.hdu_info:
              if name == '*' or name == info.name:
                  if extver == '*' or extver == str(info.extver):
                      idx_lst.append(info.index)
  
          return idx_lst
docs: Parameters
          ----------
          idx_spec : str
              A string in the form of a pair of brackets enclosing some
              index expression matching HDUs in the file
  
          Returns
          -------
          result : list
              A list of HDU indexes that can be used to access each HDU
              matching the pattern