src/ExpressionValidator.php
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
			);
		}
	}
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
			);
		}
	}
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 ) ; } }
Validates the given expression and tracks it.
VALIDATE_PREFIX won't track prefixes.

@param string $expression
@param int $options
@throws InvalidArgumentException
Validates the given expression and tracks it . VALIDATE_PREFIX won t track prefixes .