NAME
Sah::Schemas::Str - Various string schemas
VERSION
This document describes version 0.014 of Sah::Schemas::Str (from Perl distribution Sah-Schemas-Str), released on 2023-09-03.
SAH SCHEMAS
The following schemas are included in this distribution:
-
String of bytes in hexadecimal notation, e.g. "ab99" or "CAFE".
Whitespace is allowed and will be removed.
-
String containing only zero or more Latin letters, i.e. A-Z or a-z.
-
String containing only zero or more Latin letters/digits, i.e. A-Za-z0-9.
-
A single latin letter, i.e. A-Z or a-z.
-
String containing only zero or more lowercases Latin letters, i.e. a-z.
Uppercase letters will be coerced to lowercase.
-
A single latin lowercase letter, i.e. a-z.
-
String containing only zero or more uppercase Latin letters, i.e. A-Z.
Uppercase letters will be coerced to lowercase.
-
A single latin uppercase letter, i.e. A-Z.
-
A non-empty string (length >= 1) (alias for str1).
-
A number in percent form, e.g. "10.5%".
This schema accepts floating number followed by percent sign. Unlike the
percent
schema from Sah::Schemas::Float, The percent sign will not be removed nor the number be converted to decimal (e.g. 50% to 0.5). -
A non-empty string (length >= 1).
-
String or array (0+ length) of (defined) string.
-
String or array (1+ length) of (defined) string.
-
String or regex (if string is of the form `/.../`).
Either string or Regexp object is accepted.
If string is of the form of
/.../
orqr(...)
, then it will be compiled into a Regexp object. If the regex pattern inside/.../
orqr(...)
is invalid, value will be rejected.Currently, unlike in normal Perl, for the
qr(...)
form, only parentheses(
and)
are allowed as the delimiter.Currently modifiers
i
,m
, ands
after the second/
are allowed.
HOMEPAGE
Please visit the project's homepage at https://metacpan.org/release/Sah-Schemas-Str.
SOURCE
Source repository is at https://github.com/perlancar/perl-Sah-Schemas-Str.
SEE ALSO
Sah - schema specification
Data::Sah - Perl implementation of Sah
Related schemas from Sah::Schemas::Re
AUTHOR
perlancar <perlancar@cpan.org>
CONTRIBUTING
To contribute, you can send patches by email/via RT, or send pull requests on GitHub.
Most of the time, you don't need to build the distribution yourself. You can simply modify the code, then test via:
% prove -l
If you want to build the distribution (e.g. to try to install it locally on your system), you can install Dist::Zilla, Dist::Zilla::PluginBundle::Author::PERLANCAR, Pod::Weaver::PluginBundle::Author::PERLANCAR, and sometimes one or two other Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond that are considered a bug and can be reported to me.
COPYRIGHT AND LICENSE
This software is copyright (c) 2023, 2022, 2020 by perlancar <perlancar@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
BUGS
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Sah-Schemas-Str
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.