Match an item metadata field value by pattern.

	Note:
		Metadata values are lowercased when ``normalized_values`` is ``True``,
		so ``ignore_case`` is automatically set to ``True``.

	Parameters:
		field_value (list or str): A metadata field value to check.
		pattern (str): A regex pattern to check the field value(s) against.
		ignore_case (bool): Perform case-insensitive matching.
			Default: ``False``
		normalize_values (bool): Normalize metadata values to remove common differences between sources.
			Default: ``False``

	Returns:
		bool: True if matched, False if not.

def _match_field(field_value, pattern, ignore_case=False, normalize_values=False):
	"""Match an item metadata field value by pattern.

	Note:
		Metadata values are lowercased when ``normalized_values`` is ``True``,
		so ``ignore_case`` is automatically set to ``True``.

	Parameters:
		field_value (list or str): A metadata field value to check.
		pattern (str): A regex pattern to check the field value(s) against.
		ignore_case (bool): Perform case-insensitive matching.
			Default: ``False``
		normalize_values (bool): Normalize metadata values to remove common differences between sources.
			Default: ``False``

	Returns:
		bool: True if matched, False if not.
	"""

	if normalize_values:
		ignore_case = True

	normalize = normalize_value if normalize_values else lambda x: str(x)
	search = functools.partial(re.search, flags=re.I) if ignore_case else re.search

	# audio_metadata fields contain a list of values.
	if isinstance(field_value, list):
		return any(search(pattern, normalize(value)) for value in field_value)
	else:
		return search(pattern, normalize(field_value))