The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Data::Sah::Type::str

VERSION

version 0.02

DESCRIPTION

str stores text. Elements of str are characters. The default encoding is utf8.

CLAUSES

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:

match => REGEX|{COMPILER=>REGEX, ...}

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.

not_match => REGEX|{COMPILER=>REGEX, ...}

Require that string not match the specified regular expression.

match_all => [REGEX, ...]|{COMPILER=>[REGEX...], ...}

Require that the string match all the specified regular expressions.

See also: match_any, match.

match_any => [REGEX, ...]|{COMPILER=>[REGEX...], ...}

Require that the string match any the specified regular expressions.

See also: match_any, match_none.

match_none => [REGEX, ...]|{COMPILER=>[REGEX...], ...}

The opposite of match_all, require that the string not match any of the specified regular expression(s).

See also: match_all, match_any.

is_regex => BOOL

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.

AUTHOR

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE

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.