docs: def expr_match(line, expr):
      '''
      Evaluate a line of text against an expression. First try a full-string
      match, next try globbing, and then try to match assuming expr is a regular
      expression. Originally designed to match minion IDs for
      whitelists/blacklists.
      '''
      if line == expr:
          return True
      if fnmatch.fnmatch(line, expr):
          return True
      try:
          if re.match(r'\A{0}\Z'.format(expr), line):
              return True
      except re.error:
          pass
      return False