src/Elements/Parents/Field.php
public function validatePattern($value)
	{
		if (!isset($this->attr["pattern"])) return true;

		$pattern = trim($this->attr["pattern"], "/");

		if (!preg_match("/{$pattern}/", $value)) {
			$this->errors[] = "\"{$this->label}\" must match the specified pattern.";
			return false;
		}

		return true;
	}
public function validatePattern($value)
	{
		if (!isset($this->attr["pattern"])) return true;

		$pattern = trim($this->attr["pattern"], "/");

		if (!preg_match("/{$pattern}/", $value)) {
			$this->errors[] = "\"{$this->label}\" must match the specified pattern.";
			return false;
		}

		return true;
	}
public function validatePattern ( $ value ) { if ( ! isset ( $ this -> attr [ "pattern" ] ) ) return true ; $ pattern = trim ( $ this -> attr [ "pattern" ] , "/" ) ; if ( ! preg_match ( "/{$pattern}/" , $ value ) ) { $ this -> errors [ ] = "\"{$this->label}\" must match the specified pattern." ; return false ; } return true ; }
Validates a form element with a pattern attribute.

@param  string $label   Form element label
@param  string $value   Current value of form field
@param  string $element Form element object
@return boolean TRUE if passed validation; FALSE if failed validation
Validates a form element with a pattern attribute .