code: def from_name_re(cls, path:PathOrStr, fnames:FilePathList, pat:str, valid_pct:float=0.2, **kwargs):
          "Create from list of `fnames` in `path` with re expression `pat`."
          pat = re.compile(pat)
          def _get_label(fn):
              if isinstance(fn, Path): fn = fn.as_posix()
              res = pat.search(str(fn))
              assert res,f'Failed to find "{pat}" in "{fn}"'
              return res.group(1)
          return cls.from_name_func(path, fnames, _get_label, valid_pct=valid_pct, **kwargsf from_name_re(cls, path:PathOrStr, fnames:FilePathList, pat:str, valid_pct:float=0.2, **kwargs):
          "Create from list of `fnames` in `path` with re expression `pat`."
          pat = re.compile(pat)
          def _get_label(fn):
              if isinstance(fn, Path): fn = fn.as_posix()
              res = pat.search(str(fn))
              assert res,f'Failed to find "{pat}" in "{fn}"'
              return res.group(1)
          return cls.from_name_func(path, fnames, _get_label, valid_pct=valid_pct, **kwargs)
docs: Create from list of `fnames` in `path` with re expression `pat`.