import typing


def get_one_gate_data_from_string(string: str, data: str) -> typing.List[int]:
	"""
	Gets certain data from a string that represents a gate.

	Parameters
	----------
		string : str
			A string representing a gate.
		data : str
			The name of the data that is wanted. The options are 'target' and 'control'.

	Returns
	----------
	A list containing the wanted data.
	"""
	target_area = string.split(f'{data}=(', 1)[1].split(")")[0]
	parts = target_area.split(',')
	if not parts[-1]:
		parts = parts[:-1]
	return [int(n) for n in parts]