import re


def _collapse_impacted_interfaces(text):
  """Removes impacted interfaces details, leaving just the summary count."""
  return re.sub(
      r"^( *)([^ ]* impacted interfaces?):\n(?:^\1 .*\n)*",
      r"\1\2\n",
      text,
      flags=re.MULTILINE)