import re


def _GetFindingIdFromName(finding_name):
  """Gets a finding id from the full resource name."""
  resource_pattern = re.compile(
      "organizations/[0-9]+/sources/[0-9-]+/findings/[a-zA-Z0-9]+")
  assert resource_pattern.match(finding_name), (
      "When providing a full resource path, it must include the pattern "
      "organizations/[0-9]+/sources/[0-9-]+/findings/[a-zA-Z0-9]+.")
  list_finding_components = finding_name.split("/")
  return list_finding_components[len(list_finding_components) - 1]