code: def replace_match(file: Path, line: str) -> str | None:
      match = EXAMPLE_DAGS_URL_MATCHER.match(line)
      if match:
          url_path_to_dir = match.group(4)
          folders = url_path_to_dir.split("/")
          example_dags_folder = (
              AIRFLOW_SOURCES_ROOT / "airflow" / "providers"
          ).joinpath(*folders) / "example_dags"
          provider, version = get_provider_and_version(url_path_to_dir)
          proper_system_tests_url = (
              f"https://github.com/apache/airflow/tree/providers-{provider}/{version}"
              f"/tests/system/providers/{url_path_to_dir}"
          )
          if not example_dags_folder.exists():
              if proper_system_tests_url in file.read_text():
                  console.print(
                      f"[yellow] Removing from {file}[/]\n{line.strip()}"
                  )
                  return None
              else:
                  new_line = re.sub(
                      EXAMPLE_DAGS_URL_MATCHER,
                      r"\1" + proper_system_tests_url + r"\5",
                      line,
                  )
                  if new_line != line:
                      console.print(
                          f"[yellow] Replacing in {file}[/]\n{line.strip()}\n{new_line.strip()}"
                      )
                  return new_line
      return line
  
file_path: airflow/scripts/ci/pre_commit/pre_commit_update_example_dags_paths.py
imports: from __future__ import annotations
  import re
  import sys
  from pathlib import Path
  import yaml
  from rich.console import Console
label_desc: Use image node_id 2 for calling a global function with example usage: replace_match(file, line) and returns: line, None, new_line