docs: def get_anchor_format(a):
      """
      Extract the resource file-type format from the anchor.
      """
  
      # (. or format=) then (file_extension) then (? or $)
      # e.g. "...format=txt" or "...download.mp4?..."
      fmt = re.search(r"(?:\.|format=)(\w+)(?:\?.*)?$", a)
      return fmt.group(1) if fmt else None