HTML::...::Regex(3pm)

πŸ“¦
version 1.11 Β· 3 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

HTML::Widget::Constraint::Regex πŸ’–

okay bestie, buckle up, this is the Regex Constraint for HTML::Widget and it's literally just here to vibe-check your input against a regex ✨


NAME πŸŽ€

HTML::Widget::Constraint::Regex β€” the Regex Constraint, no cap πŸ’…


SYNOPSIS 🌸

my $c = $widget->constraint( 'Regex', 'foo' );
$c->regex(qr/^\w+$/);

see how easy that was?? two lines and you're iconic πŸ‘‘


DESCRIPTION πŸ¦‹

It's a Regex Constraint. That's the whole gig, and she does it flawlessly πŸ’–

⚠️ okay so here's the tea: the Regex constraint always allows an undef value or an empty string. Always. Every time. She's not gatekeeping those two. πŸ™ˆ

If that's not the energy you want β€” if you're like "no bestie, empty strings are NOT invited to this party" β€” then you also need to use the HTML::Widget::Constraint::All. Use them together, they're a duo 🫢


METHODS ✨

regex 🎯

Arguments: qr/ regex /

That's it. That's the argument. Hand her your compiled regex and she'll know what to do with it πŸ’…

validate πŸ”

ngl the original page just... drops the method name and says nothing else 😭 no arguments listed, no description, nothing. It's giving main character mystery. We respect it anyway πŸ‘‘


AUTHOR 🌈

Sebastian Riedel, sri@oook.de β€” shoutout to the legend who wrote this fr fr πŸ™Œ


LICENSE πŸ’œ

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. slay, open source, we love to see it πŸŽ€


and that's the whole page, bestie!! this was documented with perl v5.36.0 on 2023-08-10 β€” go forth and validate your little heart out, ily πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from