public function setValues(array $values, $caseSensitive = false)
	{
		if (!is_bool($caseSensitive))
		{
			throw new InvalidArgumentException('Argument 2 passed to ' . __METHOD__ . ' must be a boolean');
		}

		// Create a regexp based on the list of allowed values
		$regexp = RegexpBuilder::fromList($values, ['delimiter' => '/']);
		$regexp = '/^' . $regexp . '$/D';

		// Add the case-insensitive flag if applicable
		if (!$caseSensitive)
		{
			$regexp .= 'i';
		}

		// Add the Unicode flag if the regexp isn't purely ASCII
		if (!preg_match('#^[[:ascii:]]*$#D', $regexp))
		{
			$regexp .= 'u';
		}

		// Set the regexp associated with this list of values
		$this->setRegexp($regexp);
	}