code: def filter(self, pattern):
          
          if isinstance(pattern, REGEX_TYPE):
              func = tools.filter_regex
          elif pattern.startswith('/'):
              pattern = re.compile(pattern.strip('/'))
              func = tools.filter_regex
          else:
              func = tools.filter_wildcard
  
          return SeeResult(func(self, pattern))
docs: Filter the results using a pattern.
  
          This accepts a shell-style wildcard pattern (as used by the fnmatch_
          module)::
  
              >>> see([]).filter('*op*')
                  .copy()    .pop()
  
          It also accepts a regular expression. This may be a compiled regular
          expression (from the re_ module) or a string that starts with a ``/``
          (forward slash) character::
  
              >>> see([]).filter('/[aeiou]{2}/')
                  .clear()    .count()
  
          .. _fnmatch: https://docs.python.org/3/library/fnmatch.html
          .. _re: https://docs.python.org/3/library/re.html