import re


def _IsValidCompositeTypeSyntax(composite_type_name):
  """Returns true if the resource_handle matches composite type syntax.

  Args:
    composite_type_name: a string of the name of the composite type.

  Catches most syntax errors by checking that the string contains the substring
  '/composite:' preceded and followed by at least one character, none of which
  are colons, slashes, or whitespace. Periods may follow the substring, but not
  proceed it.
  """
  return re.match(r'^[^/:.\s]+/composite:[^/:\s]+$', composite_type_name)