def all_matches(names, pattern):
 matches = {}
 for (item, name) in names.items():
  m = re.match(pattern, name, re.IGNORECASE)
  if (m and m.groupdict()):
   matches[item] = m.groupdict()
  else:
   return None
 return matches

def all_matches ( names , pattern ) : matches = { } for ( item , name ) in names . items ( ) : m = re . match ( pattern , name , re . IGNORECASE ) if ( m and m . groupdict ( ) ) : matches [ item ] = m . groupdict ( ) else : return None return matches
if all the filenames in the item/filename mapping match the pattern .