Types::...StrMatch(3)
π Types::...StrMatch(3) π
Spotted in the wild under User Contributed Perl Documentation β and yes, bestie, we're getting into Types::Standard::StrMatch together. It's giving exporter-utility realness, so grab a strawberry drink and let's go πβ¨
πΈ NAME πΈ
Types::Standard::StrMatch β the exporter utility for the StrMatch type constraint. Lowkey iconic, highkey useful π
β¨ SYNOPSIS β¨
use Types::Standard -types;
# Normal way to validate a string against a regular expression.
#
StrMatch->of( qr/.../ )->assert_valid( "foo" );
use Types::Standard::StrMatch Identifier => { re => qr/.../ },
# Exported shortcut
#
assert_Identifier "foo";
π¦ STATUS π¦
Real talk: this module is not covered by the Type-Tiny stability policy. So don't come for it with stability expectations, okay? π
π DESCRIPTION π
This is mostly internal code, but it can also act as an exporter utility. It's giving "backstage pass but make it Perl" energy π«Ά
π Exports π
Types::Standard::ScalarRef can be used experimentally as an exporter β that's what the docs say, and I'm repeating it exactly, no edits, no cap.
use Types::Standard::StrMatch Identifier => { re => qr/.../ };
This will export the following functions into your namespace:
Identifieris_Identifier( $value )assert_Identifier( $value )to_Identifier( $value )
Multiple types can be exported at once:
use Types::Standard -types;
use Types::Standard::StrMatch (
Identifier => { re => qr/.../ },
Url => { re => qr/.../ },
Email => { re => qr/.../ },
);
assert_Email 'tobyink@example.net'; # should not die
It's possible to further constrain the string using where:
use Types::Standard::StrMatch MyThing => { re => qr/.../, where => sub { ... } };
π BUGS π
Please report any bugs to <https://github.com/tobyink/p5-type-tiny/issues>. Do it for the plot, bestie πβ¨
π SEE ALSO π
Types::Standard.
πΈ AUTHOR πΈ
Toby Inkster <tobyink@cpan.org>.
π COPYRIGHT AND LICENCE π
This software is copyright (c) 2013-2025 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
π¨ DISCLAIMER OF WARRANTIES π¨
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Okay that's the whole page, and we're signing off with perl v5.42.2 energy, dated 2026-04-07 β bye bestie, stay regex-ready π
π«Άπ
π¦ where this page comes from
- alpine 3.24: perl-type-tiny-doc 2.010001-r0 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms