private function transform(string $text, string $valid, iterable $transforms, string $locale): string
	{
		$regexRegular = '([^'.$valid.']+)us';
		$regexCase = $this->createCaseRegex($valid);

		foreach ($transforms as $transform) {
			$regex = ($transform === 'Lower' || $transform === 'Upper') ? $regexCase : $regexRegular;
			if ($locale) {
				$text = $this->applyTransformRule($text, $transform, $locale, $regex);
			}
			$text = $this->applyTransformRule($text, $transform, '', $regex);
		}

		return $text;
	}