public function validate( $input )
    {
        // Check if regular expression matches the input string.
        if ( !preg_match( $this->regexp, $input ) )
        {
            throw new phpillowValidationException(
                'Input %input did not match regular expression %expression.', 
                array(
                    'input' => $input,
                    'expression' => $this->regexp,
                )
            );
        }

        return (string) $input;
    }
public function validate( $input )
    {
        // Check if regular expression matches the input string.
        if ( !preg_match( $this->regexp, $input ) )
        {
            throw new phpillowValidationException(
                'Input %input did not match regular expression %expression.', 
                array(
                    'input' => $input,
                    'expression' => $this->regexp,
                )
            );
        }

        return (string) $input;
    }
public function validate ( $ input ) { // Check if regular expression matches the input string. if ( ! preg_match ( $ this -> regexp , $ input ) ) { throw new phpillowValidationException ( 'Input %input did not match regular expression %expression.' , array ( 'input' => $ input , 'expression' => $ this -> regexp , ) ) ; } return ( string ) $ input ; }
Validate input string against a regexp

Validates the input string against the configured regular expression.

@param mixed $input
@return string
Validate input string against a regexp