Andrew Sterling Hanenkamp > Form-Factory > Form::Factory::Feature::Control::MatchRegex

Download:
Form-Factory-0.020.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.020   Source  

NAME ^

Form::Factory::Feature::Control::MatchRegex - Match a control value against a regex

VERSION ^

version 0.020

SYNOPSIS ^

  has_control five_char_palindrome => (
      control => 'text',
      features => {
          match_regex => {
              regex => qr/(.)(.).\2\1/,
              message => 'the %s is not a palindrome',
          },
      },
  );

DESCRIPTION ^

Checks that the control value matches a regular expression. Returns an error if it does not.

ATTRIBUTES ^

regex

The regular expression to use.

METHODS ^

check_control

Checks that the control does Form::Factory::Control::Role::ScalarValue.

check

Runs the regular expression against the current value of the control and reports an error if it does not match.

AUTHOR ^

Andrew Sterling Hanenkamp <hanenkamp@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright 2009 Qubling Software LLC.

This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: