Perl::...nything(3pm)
okay so bestie, welcome to the Perl::...nything(3pm) page from the User Contributed Perl Documentation π we are diving in, and yes itβs giving very specific regex energy β¨
πΈ NAME πΈ
Perl::Critic::Policy::RegularExpressions::RequireDotMatchAnything β always use the /s modifier with regular expressions. periodt π
π¦ AFFILIATION π¦
This Policy is part of the core Perl::Critic distribution. iconic, honestly π
π DESCRIPTION π
okay so when someone asks what . means in a regular expression, most people will say it matches any character β and that is not true, bestie π itβs actually shorthand for [^\n]. using the s modifier makes . act like people expect it to π«
my $match = m< foo.bar >xm; # not ok
my $match = m< foo.bar >xms; # ok
see? the s is doing the lordβs work π
β¨ CONFIGURATION β¨
This Policy is not configurable except for the standard options. thatβs it, thatβs the config section π
π NOTES π
be cautious about slapping modifier flags onto existing regular expressions, because they can drastically alter their meaning π³ seriously, do not just vibe-check your way through regex flags. See http://www.perlmonks.org/?node_id=484238 for an interesting discussion on the effects of blindly modifying regular expression flags π
π«Ά AUTHOR π«Ά
Jeffrey Ryan Thalhammer β <jeff@imaginative-software.com> π
π COPYRIGHT π
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. slay, legal bestie π
and thatβs the whole page, bestie π«Ά the footer says perl v5.42.0, dated 2024-10-23, and this manual is Perl::...nything(3pm). mwah π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Perl-Critic 1.156.0-bp160.1.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms