Create a new FileCollection, and select all files except file
        matching ignore-rule::
            
            dir_path = "your/path"
            fc = FileCollection.from_path_by_pattern(
                dir_path, pattern=["log"])
        
        :param dir_path: the root directory you want to start with
        :param pattern: any file or directory that contains this pattern
          will be selected.
          
        **中文文档**
        
        选择dir_path下的所有文件的相对路径中包含有pattern的文件。

def from_path_by_pattern(dir_path, pattern=list()):
        """Create a new FileCollection, and select all files except file
        matching ignore-rule::
            
            dir_path = "your/path"
            fc = FileCollection.from_path_by_pattern(
                dir_path, pattern=["log"])
        
        :param dir_path: the root directory you want to start with
        :param pattern: any file or directory that contains this pattern
          will be selected.
          
        **中文文档**
        
        选择dir_path下的所有文件的相对路径中包含有pattern的文件。
        """
        pattern = [i.lower() for i in pattern]
        def filter(winfile):
            relpath = os.path.relpath(winfile.abspath, dir_path).lower()
            for p in pattern:
                if p in relpath:
                    return True
            return False
        
        return FileCollection.from_path_by_criterion(
            dir_path, filter, keepboth=False)