Claes Jakobsson > VS-RuleEngine > VS::RuleEngine::Rule::InputMatchesRegexp

Download:
VS-RuleEngine-0.09.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source  

NAME ^

VS::RuleEngine::Rule::InputMatchesRegexp - Generic rule for matching inputs against regular expressions

SYNOPSIS ^

  use VS::RuleEngine::Declare;
  
  my $engine = engine {
      rule 'valid_name' => instanceof "VS::RuleEngine::Rule::InputMatchesRegexp" => with_args {
          'name' => qr/^\w+$/;
      }
  }

DESCRIPTION ^

This is a generic rule that matches input against regular expressions (Perl5). All defined inputs must match their respective regexp for the rule to match. If no inputs are defined or any input doesn't match its regexp the rule does not match.

USAGE ^

Rule arguments

This rule expects a hash reference as its argument, which is what with_args provides, where the key is the name of an input and the value is the regexp to match against.

syntax highlighting: