<?php
/* SVN FILE: $Id: validators.php 2951 2006-05-25 22:12:33Z phpnut $ */
/**
 * Tort Validators
 *
 * Used to validate data in Models.
 *
 * PHP versions 4 and 5
 *
 * CakePHP :  Rapid Development Framework <http://www.cakephp.org/>
 * Copyright (c)	2006, Cake Software Foundation, Inc.
 *			1785 E. Sahara Avenue, Suite 490-204
 *			Las Vegas, Nevada 89104
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @filesource
 * @copyright		Copyright (c) 2006, Cake Software Foundation, Inc.
 * @link				http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
 * @package			cake
 * @subpackage		cake.cake.libs
 * @since			CakePHP v 0.2.9
 * @version			$Revision: 2951 $
 * @modifiedby		$LastChangedBy: phpnut $
 * @lastmodified	$Date: 2006-05-25 17:12:33 -0500 (Thu, 25 May 2006) $
 * @license			http://www.opensource.org/licenses/mit-license.php The MIT License
 */
/**
 * Not empty.
 */
	define('VALID_NOT_EMPTY', '/.+/');
/**
 * Numbers [0-9] only.
 */
	define('VALID_NUMBER', '/^[0-9]+$/');
/**
 * A valid email address.
 */
 	//define('VALID_EMAIL', '/^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/');
	define('VALID_EMAIL', '/\\A(?:^([a-z0-9][a-z0-9_\\-\\.\\+]*)@([a-z0-9][a-z0-9\\.\\-]{0,63}\\.(com|org|net|biz|info|name|net|pro|aero|coop|museum|[a-z]{2,4}))$)\\z/i');
/**
 * A valid year (1000-2999).
 */
	define('VALID_YEAR', '/^[12][0-9]{3}$/');
/**
 * A valid name (fist or last).
 */
	define('VALID_NAME', '/^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*$/');
/**
 * A valid username
 */
	define('VALID_USERNAME', '/(?!^ *$)^[a-zA-Z0-9 \$_@\&\.!\+]*$/');	
/**
 * A valid password
 */
	define('VALID_PASSWORD', '/^[a-zA-Z]\w$/');	
/**
 * A valid word
 */	
	define('VALID_WORD', '/^\\w+$/');
/**
 * A valid zipcode (US) 
 */	
	define('VALID_USZIPCODE', '/^\d{5}(-\d{4})?$/');
/**
 * varifies that the value of that field is unique to its model
 */
	define('VALID_UNIQUE', 'isUnique');
/**
 * varifies the length of entered content falls between a set min and max (values set in model)
 */
	define('VALID_LENGTH_WITHIN', 'isLengthWithin');
/**
 * varifies that the value matches its confirmation value ie. email and email_confirmation
  */
	define('VALID_CONFIRMED', 'isConfirmed');

?>