Valida...Pattern(3pm)
π NAME π
okay bestie, so Validation::Class::Directive::Pattern is the Pattern Directive for Validation Class field definitions. that's it, that's the whole vibe. she validates patterns. periodt. π
β¨ VERSION β¨
this one's rocking version 7.900059 π
π¦ SYNOPSIS π¦
okay so here's how you actually use her, no cap:
use Validation::Class::Simple;
my $rules = Validation::Class::Simple->new(
fields => {
company_email => {
pattern => qr/\@company\.com$/
}
}
);
# set parameters to be validated
$rules->params->add($parameters);
# validate
unless ($rules->validate) {
# handle the failures
}
like, you set the params, you validate, and if it flops you deal with the failures. simple as that, fr fr π«Ά
πΈ DESCRIPTION πΈ
Validation::Class::Directive::Pattern is a core validation class field directive that validates simple patterns and complex regular expressions. she's not picky, she does both. versatile queen. π
- alternative argument: an-array-of-something
so you can pass this directive either a regexp object OR a simple pattern. and what's a simple pattern, you ask? it's a string where the # character matches digits and the X character matches alphabetic characters. iykyk π«
so like:
fields => {
task_date => {
pattern => '##-##-####'
},
task_time => {
pattern => '##:##:##'
}
}
see how ##-##-#### is giving date and ##:##:## is giving time? the #s are your lil digit placeholders. it's literally that easy bestie π
π AUTHOR π
Al Newkirk <anewkirk@ana.io> β the icon, the legend, the main character who wrote this β¨
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2011 by Al Newkirk.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so go off, remix her, just keep it legal bestie π
and that's the whole page! perl v5.36.0 did the formatting, dated 2023-06-11, and the page herself is Valida...Pattern(3pm). mwah, go validate something cute ππΈ
π¦ where this page comes from
- debian trixie: libvalidation-class-perl 7.900059-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libvalidation-class-perl 7.900059-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libvalidation-class-perl 7.900059-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libvalidation-class-perl 7.900059-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms