logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Perl::Critic::Policy::RegularExpressions::ProhibitUnusualDelimiters - Use only "//" or "{}" to delimit

Affiliation

       This Policy is part of the core Perl::Critic distribution.

Author

       Chris Dolan <cdolan@cpan.org>

Configuration

       There is one option for this policy, "allow_all_brackets".  If this is true, then, in addition to
       allowing "//" and "{}", the other matched pairs of "()", "[]", and "<>" are allowed.

Credits

       Initial development of this policy was supported by a grant from the Perl Foundation.

Description

       Perl lets you delimit regular expressions with almost any character, but most choices are illegible.
       Compare these equivalent expressions:

         s/foo/bar/;   # good
         s{foo}{bar};  # good
         s#foo#bar#;   # bad
         s;foo;bar;;   # worse
         s|\|\||\||;   # eye-gouging bad

Name

       Perl::Critic::Policy::RegularExpressions::ProhibitUnusualDelimiters - Use only "//" or "{}" to delimit
       regexps.

See Also