Daisuke Murase > FormValidator-Lite-0.15 > FormValidator::Lite::Constraint::Default

Download:
FormValidator-Lite-0.15.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source   Latest Release: FormValidator-Lite-0.37

NAME ^

FormValidator::Lite::Constraint::Default - default constraint rules

DESCRIPTION ^

This module provides default constraint rules for FormValidator::Lite.

CONSTRAINTS ^

NOT_NULL

The parameter is true value or not.

NOT_BLANK

Synonym of NOT_NULL.

INT

The parameter looks like a integer? i.e. It matches /^[+\-]?[0-9]+$/?

UINT

The parameter looks like a unsigned integer? i.e. It matches /^[0-9]+$/?

ASCII
    $_ =~ /^[\x21-\x7E]+$/

The parameter is just ASCII?

DUPLICATION
    $validator->check(
        {mails => [qw/mail1 mail2/]} => ['DUPLICATION']
    );

The two parameters have same value?

DUP

Synonym of DUPLICATION.

LENGTH
    $validator->check(
        name     => [[qw/LENGTH 5 20/]],
        password => [[qw/LENGTH 5/]],
    );

Check the length of data. First argument means $minumum value, second argument is $max. $max is optional.

REGEX
    $validator->check(
        name => [[REGEXP => qr/^[0-9]$/]],
    );

Check regexp matches parameter or not.

REGEXP

Synonym of REGEX.

CHOICE
    $validator->check(
        sex => [[CHOICE => qw/male female/]]
    );

The parameter is one of choice or not.

syntax highlighting: