def checkAgentCaseExclude(patterns, agent, case):
   """
   Check if we should exclude a specific case for given agent.
   """
   for p in patterns:
      if p[0].match(agent):
         for pp in p[1]:
            if pp.match(case):
               return True
   return False