Data::Sah::Type::str
version 0.02
str stores text. Elements of str are characters. The default encoding is utf8.
Unless specified otherwise, all clauses have a priority of 50 (normal).
str assumes the following roles: Data::Sah::Type::Base, Data::Sah::Type::Comparable, Data::Sah::Type::Sortable, and Data::Sah::Type::HasElems. Consult the documentation of those role(s) to see what clauses are available.
In addition, str defines these clauses:
Require that string match the specified regular expression.
Since regular expressions might not be 100% compatible from language to language due to different flavors/implementations, instead of avoiding the use of regex entirely, you can specify different regex for each target language, e.g.:
[str => {match => { js => '...', perl => '...', python => '...', }}]
See also: match_all, match_any for matching against multiple regexes.
Require that string not match the specified regular expression.
Require that the string match all the specified regular expressions.
See also: match_any, match.
Require that the string match any the specified regular expressions.
See also: match_any, match_none.
The opposite of match_all, require that the string not match any of the specified regular expression(s).
See also: match_all, match_any.
If value is true, require that the string be a valid regular expression string. If value is false, require that the string not be a valid regular expression string.
Steven Haryanto <stevenharyanto@gmail.com>
This software is copyright (c) 2012 by Steven Haryanto.
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::Sah, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Sah
CPAN shell
perl -MCPAN -e shell install Data::Sah
For more information on module installation, please visit the detailed CPAN module installation guide.