universeodon.com is part of the decentralized social network powered by Mastodon.
Be one with the #fediverse. Join millions of humans building, creating, and collaborating on Mastodon Social Network. Supports 1000 character posts.

Administered by:

Server stats:

3.3K
active users

Learn more

#regexes

0 posts0 participants0 posts today
N-gated Hacker News<p>Parser combinators in <a href="https://mastodon.social/tags/Haskell" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Haskell</span></a> are like the cool kids at school 🎓, effortlessly solving Advent of Code problems while <a href="https://mastodon.social/tags/regexes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regexes</span></a> are stuck in detention 🚫. Who knew regexes were still a thing in 2025? 😂 In Haskell, we leave those relics to flounder in the past while we flex our combinator muscles 💪.<br><a href="https://entropicthoughts.com/parser-combinators-beat-regexes" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">entropicthoughts.com/parser-co</span><span class="invisible">mbinators-beat-regexes</span></a> <a href="https://mastodon.social/tags/ParserCombinators" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ParserCombinators</span></a> <a href="https://mastodon.social/tags/AdventOfCode" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>AdventOfCode</span></a> <a href="https://mastodon.social/tags/FutureCoding" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>FutureCoding</span></a> <a href="https://mastodon.social/tags/Flexibility" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Flexibility</span></a> <a href="https://mastodon.social/tags/HackerNews" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>HackerNews</span></a> <a href="https://mastodon.social/tags/ngated" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ngated</span></a></p>
Hacker News<p>Parser Combinators Beat Regexes</p><p><a href="https://entropicthoughts.com/parser-combinators-beat-regexes" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">entropicthoughts.com/parser-co</span><span class="invisible">mbinators-beat-regexes</span></a></p><p><a href="https://mastodon.social/tags/HackerNews" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>HackerNews</span></a> <a href="https://mastodon.social/tags/ParserCombinators" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ParserCombinators</span></a> <a href="https://mastodon.social/tags/Regexes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Regexes</span></a> <a href="https://mastodon.social/tags/CodingTechniques" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CodingTechniques</span></a> <a href="https://mastodon.social/tags/FunctionalProgramming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>FunctionalProgramming</span></a></p>
data0<p><a href="https://indieweb.social/tags/BadApple" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>BadApple</span></a> <a href="https://indieweb.social/tags/demo" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>demo</span></a> in <a href="https://indieweb.social/tags/vim" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>vim</span></a> only using search queries (6,500 <a href="https://indieweb.social/tags/regexes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regexes</span></a>)</p><p><a href="https://eieio.games/blog/bad-apple-with-regex-in-vim/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">eieio.games/blog/bad-apple-wit</span><span class="invisible">h-regex-in-vim/</span></a></p><p><a href="https://indieweb.social/tags/demoscene" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>demoscene</span></a> <a href="https://indieweb.social/tags/regex" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regex</span></a> <a href="https://indieweb.social/tags/neovim" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>neovim</span></a></p>
Cosmin Saveanu<p>Never before had I considered the importance of "greedy" and "lazy" options for <a href="https://framapiaf.org/tags/regular" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regular</span></a> expression matches. By default, regular expression engines try to match the maximum of a chain of characters, but for years I used <a href="https://framapiaf.org/tags/regexes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regexes</span></a> not knowing the difference between "x?" and "+?". In one case the question mark says that "x" is optional, in the other, says that searching should stop as soon as a match was found. Clearly explained here and very important:</p><p><a href="https://stackoverflow.com/questions/2301285/what-do-lazy-and-greedy-mean-in-the-context-of-regular-expressions" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">stackoverflow.com/questions/23</span><span class="invisible">01285/what-do-lazy-and-greedy-mean-in-the-context-of-regular-expressions</span></a></p>
Mark Gardner<p><span class="h-card" translate="no"><a href="https://mastodon.social/@neustradamus" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>neustradamus</span></a></span> <a href="https://social.sdf.org/tags/PCRE" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PCRE</span></a> continues to be a misnomer; it’s a modified subset of <a href="https://social.sdf.org/tags/Perl" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Perl</span></a> <a href="https://social.sdf.org/tags/RegularExpressions" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegularExpressions</span></a> with dozens of differences: <a href="https://pcre.org/current/doc/html/pcre2compat.html" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">pcre.org/current/doc/html/pcre</span><span class="invisible">2compat.html</span></a></p><p>It's not "(C)ompatible." Accept no substitutes: <a href="https://perldoc.perl.org/perlre" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">perldoc.perl.org/perlre</span><span class="invisible"></span></a></p><p><a href="https://social.sdf.org/tags/PCRE2" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PCRE2</span></a> <a href="https://social.sdf.org/tags/PerlIncompatibleRegularExpressions" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PerlIncompatibleRegularExpressions</span></a> <a href="https://social.sdf.org/tags/RegularExpression" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegularExpression</span></a> <a href="https://social.sdf.org/tags/RegExes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegExes</span></a> <a href="https://social.sdf.org/tags/RegExps" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegExps</span></a> <a href="https://social.sdf.org/tags/regex" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regex</span></a> <a href="https://social.sdf.org/tags/regexp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regexp</span></a></p>
Mark Gardner<p><span class="h-card" translate="no"><a href="https://mstdn.ca/@sparkman" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>sparkman</span></a></span> Some people, when confronted with another person solving a problem with <a href="https://social.sdf.org/tags/RegularExpressions" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegularExpressions</span></a>, think, “I know, I’ll quote <span class="h-card" translate="no"><a href="https://mastodon.social/@jwz" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>jwz</span></a></span>.” Now they feel clever without having to contribute anything.</p><p><a href="https://social.sdf.org/tags/RegExes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegExes</span></a> <a href="https://social.sdf.org/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> <a href="https://social.sdf.org/tags/coding" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>coding</span></a> <a href="https://social.sdf.org/tags/SoftwareDevelopment" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>SoftwareDevelopment</span></a></p>
Mark Gardner<p><span class="h-card" translate="no"><a href="https://fosstodon.org/@mort" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>mort</span></a></span> You can get pretty far with <a href="https://social.sdf.org/tags/Perl" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Perl</span></a> 5* <a href="https://social.sdf.org/tags/RegularExpressions" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegularExpressions</span></a>. Here's <span class="h-card" translate="no"><a href="https://mastodon.online/@perlancar" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>perlancar</span></a></span>’s <a href="https://social.sdf.org/tags/CPAN" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CPAN</span></a> module based on <span class="h-card" translate="no"><a href="https://fluttercommunity.social/@randalschwartz" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>randalschwartz</span></a></span>’s minimal <a href="https://social.sdf.org/tags/JSON" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>JSON</span></a> parser as a single <a href="https://social.sdf.org/tags/regex" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regex</span></a>: <a href="https://metacpan.org/pod/JSON::Decode::Regexp" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">metacpan.org/pod/JSON::Decode:</span><span class="invisible">:Regexp</span></a></p><p>Full docs on conditional <a href="https://social.sdf.org/tags/regexes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regexes</span></a>, including the special `(DEFINE)` form that merlyn used: <a href="https://perldoc.perl.org/perlre#condition-yes-pattern-no-pattern" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">perldoc.perl.org/perlre#condit</span><span class="invisible">ion-yes-pattern-no-pattern</span></a></p><p>* <a href="https://social.sdf.org/tags/RakuLang" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RakuLang</span></a> hasn't been called <a href="https://social.sdf.org/tags/Perl6" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Perl6</span></a> for four years now. You're deadnaming the language.</p>
Mark Gardner<p><span class="h-card" translate="no"><a href="https://mastodon.online/@vwbusguy" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>vwbusguy</span></a></span> <span class="h-card" translate="no"><a href="https://infosec.exchange/@barubary" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>barubary</span></a></span><br><span class="h-card" translate="no"><a href="https://chirp.social/@Perl" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>Perl</span></a></span> I’m glad <a href="https://mastodon.online/@vwbusguy/111212516938547685" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">mastodon.online/@vwbusguy/1112</span><span class="invisible">12516938547685</span></a> works for you, but I feel pity for when you come back to it later.</p><p>It’s nothing to do with <a href="https://social.sdf.org/tags/Perl" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Perl</span></a> and everything to do with shitty <a href="https://social.sdf.org/tags/regex" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regex</span></a> possible in almost any <a href="https://social.sdf.org/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> language.</p><p>Though it’s true that Perl’s reputation took a lot of damage from shitty developers filling the world with shitty <a href="https://social.sdf.org/tags/regexes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regexes</span></a> in their shitty Perl code. So you’re in a big group, albeit via <a href="https://social.sdf.org/tags/Ruby" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Ruby</span></a>.</p>
Jesus Castagnetto 🇵🇪<p>Looking at some <a href="https://mastodon.social/tags/regexes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regexes</span></a> for <a href="https://mastodon.social/tags/email" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>email</span></a>, ended up going through the "bang-path" rabbit hole (user1!serv1!serv2!moreservs!someserv!user2) and other ancient stuff, finally finding: <a href="http://www.textfiles.com/humor/COMPUTER/mr.prtocl" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">http://www.</span><span class="ellipsis">textfiles.com/humor/COMPUTER/m</span><span class="invisible">r.prtocl</span></a></p>
Mark Gardner<p><span class="h-card"><a href="https://bitbang.social/@profoundlynerdy" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>profoundlynerdy</span></a></span> I don’t know anything about <a href="https://social.sdf.org/tags/Rakudo" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Rakudo</span></a>’s internals, but Is there any conceivable way for a language-neutral subset of <a href="https://social.sdf.org/tags/RakuLang" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RakuLang</span></a> <a href="https://social.sdf.org/tags/regexes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regexes</span></a> to be based on or share its code rather than reimplement them?</p><p>The subset might omit things like code interpolation. Or is it all-or-nothing?</p><p>It would be a nice teaser for the full power of Raku grammars, kind of like how <a href="https://social.sdf.org/tags/iTunes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>iTunes</span></a> for Windows was <a href="https://social.sdf.org/tags/SteveJobs" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>SteveJobs</span></a>’ offer of “a glass of water to somebody in hell.” <a href="https://a.co/5J0CTSL" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="">a.co/5J0CTSL</span><span class="invisible"></span></a></p>
Mark Gardner<p><span class="h-card"><a href="https://bitbang.social/@profoundlynerdy" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>profoundlynerdy</span></a></span> I don’t think other languages *have* “ripped off” <a href="https://social.sdf.org/tags/RakuLang" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RakuLang</span></a> <a href="https://social.sdf.org/tags/regexes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regexes</span></a> and grammars. The point of a notional “RCRE” library would be to enable that.</p>
Mark Gardner<p>Any <a href="https://social.sdf.org/tags/RakuLang" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RakuLang</span></a> core hackers want to take up this challenge?</p><p><a href="https://social.sdf.org/tags/RegularExpressions" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegularExpressions</span></a> <a href="https://social.sdf.org/tags/RegExps" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegExps</span></a> <a href="https://social.sdf.org/tags/RegExes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegExes</span></a> <a href="https://social.sdf.org/tags/RegEx" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegEx</span></a> <a href="https://ruby.social/@gd/110718818730295923" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">ruby.social/@gd/11071881873029</span><span class="invisible">5923</span></a></p>
Mark Gardner<p><span class="h-card"><a href="https://infosec.exchange/@malwareminigun" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>malwareminigun</span></a></span> <span class="h-card"><a href="https://infosec.exchange/@jernej__s" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>jernej__s</span></a></span> <a href="https://social.sdf.org/tags/Perl" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Perl</span></a> has readability affordances for <a href="https://social.sdf.org/tags/regexes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regexes</span></a> that nothing else can touch: <a href="https://perldoc.perl.org/perlre#%2Fx-and-%2Fxx" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">perldoc.perl.org/perlre#%2Fx-a</span><span class="invisible">nd-%2Fxx</span></a></p>
Mark Gardner<p>Congratulations <span class="h-card"><a href="https://mastodon.social/@siegel" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>siegel</span></a></span> and <span class="h-card"><a href="https://mastodon.social/@bbedit" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>bbedit</span></a></span> for another great feature story on the <a href="https://social.sdf.org/tags/Mac" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Mac</span></a> <a href="https://social.sdf.org/tags/AppStore" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>AppStore</span></a>. "Where Respect Is Due," indeed!</p><p><a href="https://apps.apple.com/us/story/id1435835881" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">apps.apple.com/us/story/id1435</span><span class="invisible">835881</span></a></p><p>Here are some earlier <a href="https://social.sdf.org/tags/BBEdit" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>BBEdit</span></a> stories:</p><p>• Why it's the <a href="https://social.sdf.org/tags/TextEditor" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>TextEditor</span></a> of choice for <a href="https://social.sdf.org/tags/coding" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>coding</span></a>, <a href="https://social.sdf.org/tags/writing" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>writing</span></a>, <a href="https://social.sdf.org/tags/DataScience" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>DataScience</span></a>, and more: <a href="https://apps.apple.com/us/story/id1433999132" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">apps.apple.com/us/story/id1433</span><span class="invisible">999132</span></a></p><p>• Tips for prose <a href="https://social.sdf.org/tags/writers" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>writers</span></a>: <a href="https://apps.apple.com/us/story/id1451975928" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">apps.apple.com/us/story/id1451</span><span class="invisible">975928</span></a></p><p>• Learn and experiment with <a href="https://social.sdf.org/tags/RegularExpressions" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegularExpressions</span></a> for finding and modifying text in your actual work—safely! <a href="https://apps.apple.com/us/story/id1485320067" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">apps.apple.com/us/story/id1485</span><span class="invisible">320067</span></a><br><a href="https://social.sdf.org/tags/RegEx" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegEx</span></a> <a href="https://social.sdf.org/tags/RegExes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegExes</span></a></p>
Mark Gardner<p><span class="h-card"><a href="https://mastodon.social/@regehr" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>regehr</span></a></span> <span class="h-card"><a href="https://discuss.systems/@commodore" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>commodore</span></a></span> <span class="h-card"><a href="https://discuss.systems/@dev" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>dev</span></a></span> There is even a (low-severity, a/k/a “cruel”) <a href="https://social.sdf.org/tags/PerlCritic" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PerlCritic</span></a> policy to discourage everything but $_, @_, $], and numbered <a href="https://social.sdf.org/tags/RegularExpression" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegularExpression</span></a> capture variables: <a href="https://metacpan.org/pod/Perl::Critic::Policy::Variables::ProhibitPunctuationVars" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">metacpan.org/pod/Perl::Critic:</span><span class="invisible">:Policy::Variables::ProhibitPunctuationVars</span></a></p><p><a href="https://metacpan.org/pod/Perl::Critic::Policy::Variables::ProhibitMatchVars" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">metacpan.org/pod/Perl::Critic:</span><span class="invisible">:Policy::Variables::ProhibitMatchVars</span></a> already protects you against the performance-sapping $`, $&amp;, and $' match variables</p><p>And you can configure your own prohibited list with <a href="https://metacpan.org/pod/Perl::Critic::Policy::Variables::ProhibitEvilVariables" rel="nofollow noopener noreferrer" target="_blank"><span class="invisible">https://</span><span class="ellipsis">metacpan.org/pod/Perl::Critic:</span><span class="invisible">:Policy::Variables::ProhibitEvilVariables</span></a></p><p><a href="https://social.sdf.org/tags/Perl" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Perl</span></a> <a href="https://social.sdf.org/tags/RegEx" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegEx</span></a> <a href="https://social.sdf.org/tags/RegExp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegExp</span></a> <a href="https://social.sdf.org/tags/RegExes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegExes</span></a> <a href="https://social.sdf.org/tags/RegExps" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegExps</span></a></p>
Mark Gardner<p><span class="h-card"><a href="https://techhub.social/@Codely" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>Codely</span></a></span> <span class="h-card"><a href="https://bihar.social/@drupler" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>drupler</span></a></span> It helps to build your complicated <a href="https://social.sdf.org/tags/RegularExpressions" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RegularExpressions</span></a> in pieces and store them in separate variables. You can then test them in isolation and not be confused when you concatenate them together for your actual matching.</p><p>Both <a href="https://social.sdf.org/tags/PHP" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PHP</span></a> and <a href="https://social.sdf.org/tags/JavaScript" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>JavaScript</span></a> also support named capture groups if you’re doing replacements. They’re a lot more readable.</p><p>Also, PHP’s <a href="https://social.sdf.org/tags/PCRE" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>PCRE</span></a>-based engine has a PCRE_EXTENDED flag that lets you add whitespace, newlines, and comments.</p><p><a href="https://social.sdf.org/tags/regexes" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regexes</span></a> <a href="https://social.sdf.org/tags/regexps" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>regexps</span></a></p>