public function validate( $expression, $options ) {
		if ( !is_string( $expression ) ) {
			throw new InvalidArgumentException( '$expression has to be a string.' );
		}

		if ( !$this->matches( $expression, $options ) ) {
			throw new InvalidArgumentException( '$expression has to be a ' .
				implode( ' or a ', $this->getOptionNames( $options ) ) . ', got ' . $expression
			);
		}
	}