Data::Rx::Type::PCRE - PCRE string checking for Rx (experimental)
version 0.005
use Data::Rx; use Data::Rx::Type::PCRE; my $rx = Data::Rx->new({ type_plugins => [ 'Data::Rx::Type::PCRE' ] }); my $ph_number = $rx->make_schema({ type => 'tag:rjbs.manxome.org,2008-10-04:rx/pcre/str', regex => q/\A867-[5309]{4}\z/, });
This provides a new type, currently known as tag:rjbs.manxome.org,2008-10-04:rx/pcre/str, which checks strings against the Perl-compatible regular expression library. Note! This uses PCRE, not Perl's regular expressions. There are differences, but very few.
tag:rjbs.manxome.org,2008-10-04:rx/pcre/str
Schema definitions must have a regex parameter, which provides the regular expression as a string. They may also have a flags parameter, which provides regular expression flags to be passed to the (?i-i) style flag modifier.
regex
flags
(?i-i)
This plugin is still pretty experimental. When it's less so, it may get a new type URI. Its interface may change between now and then.
Ricardo SIGNES <rjbs@cpan.org>
This software is copyright (c) 2013 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Data::Rx::Type::PCRE, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Rx::Type::PCRE
CPAN shell
perl -MCPAN -e shell install Data::Rx::Type::PCRE
For more information on module installation, please visit the detailed CPAN module installation guide.