$validate = array( 'require'=> '/.+/', 'email' => '/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/', 'url' => '/^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$/', 'currency' => '/^\d+(\.\d+)?$/', 'number' => '/\d+$/', 'zip' => '/^[1-9]\d{5}$/', 'integer' => '/^[-\+]?\d+$/', 'double' => '/^[-\+]?\d+(\.\d+)?$/', 'english' => '/^[A-Za-z]+$/', ); ThinkPHP\Lib\Think\Core\Model.class.php 可以任意添加你要的正则 使用方法 在 Model 当中 AaaModel.class.php 定义 protected $_validate = array( array('name','require','参数名称必须'), array('name','checkName','参数已经定义',0,'callback'), );