规则名 | 参数 | Rule Description |
required | Some input is required in the field. 必填字段 | |
maxlength | $length | The input can be at most $length characters. 最大字符数 |
minlength | $length | The input must be at least $length characters. 最少字符数 |
regex | $rx | The input must match the regular expression $rx. 正则表达式 |
The input must be a likely syntactically valid e-mail address.* 必须是email | ||
emailorblank | The input must be blank or satisfy the email rule. 必须是emai或空 | |
lettersonly | The input must contain only alphabetic characters. 必须是字母 | |
alphanumeric | The input must contain only letters and numbers. 必须是字母和数字 | |
numeric | The input must contain a valid positive or negative integer or decimal number.必须是数字 | |
nopunctuation | The input must not contain any of these characters: ( ) . / * ^ ? # ! @ $ % + = , " ' > < ~ [ ] { }. 不能包含英文特殊字符 | |
nonzero | The input must not begin with zero. 不能是0开头 |
Note: *The regular expression that the email and emailorblank rules use to determine a valid e-mail address is /^[a-zA-Z0-9\._-]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}| [0-9]{1,3})(\]?)$/'.