NAME
Validator::Lazy::Role::Check::RegExp
VERSION
Version 0.01
SYNOPSIS
use Validator::Lazy;
my $v = Validator::Lazy->new( { regexp => { RegExp => [ list of regexps for checking ] } } );
my $ok = $v->check( regexp => 'xxxxx' ); # true / false
say Dumper $v->errors; # [ { code => 'REGEXP_ERROR', field => 'regexp', data => { expr => 'expr_which_check_is_fail' } } ]
DESCRIPTION
An internal Role for Validator::Lazy, part of Validator::Lazy package.
Provides "RegExp" type for Validator::Lazy config.
Allows to check value by regular expressions.
METHODS
check
Called from inside if Validator::Lazy->check process
Temporary overrides internal Validator::Lazy::check method like this:
$validator->check( $value, $param );
$param - is a regular expression string or list of regular expressions
each param should be a string in format = '/your-regexp-here/aimsx'
all modificators can be combined with other, and all of them can be omitted
examples:
'/^\d+$/' # integer
'^[A-Z][a-z]{1,64}$' # name
etc.
$value - your value to check
SUPPORT AND DOCUMENTATION
After installing, you can find documentation for this module with the perldoc command.
perldoc Validator::Lazy
You can also look for information at:
RT, CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Validator-Lazy
AnnoCPAN, Annotated CPAN documentation
http://annocpan.org/dist/Validator-Lazy
CPAN Ratings
http://cpanratings.perl.org/d/Validator-Lazy
Search CPAN
http://search.cpan.org/dist/Validator-Lazy/
AUTHOR
ANTONC <antonc@cpan.org>
LICENSE
This program is free software; you can redistribute it and/or modify it
under the terms of the the Artistic License (2.0). You may obtain a
copy of the full license at:
L<http://www.perlfoundation.org/artistic_license_2_0>