def METHOD_NAME(base_dir):
  # create a simple parser that pulls the export_version from the directory.
  def parser(path):
    # Modify the path object for RegEx match for Windows Paths
    if os.name == "nt":
      match = re.match(
          r"^" + compat.as_str_any(base_dir).replace("\\", "/") + r"/(\d+)$",
          compat.as_str_any(path.path).replace("\\", "/"))
    else:
      match = re.match(r"^" + compat.as_str_any(base_dir) + r"/(\d+)$",
                       compat.as_str_any(path.path))
    if not match:
      return None
    return path._replace(export_version=int(match.group(1)))
  return parser