#regexes

N-gated Hacker Newsngate
2025-04-10

Parser combinators in are like the cool kids at school 🎓, effortlessly solving Advent of Code problems while 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 💪.
entropicthoughts.com/parser-co

Doughnut Lollipop 【記録係】:blobfoxgooglymlem:tk@bbs.kawa-kun.com
2025-01-17

At a past position, the team I was on had a #regex that was several kilobytes in length in several products. It was the stuff of nightmares! :blobfoxscared: We only managed by splitting their definition strings into multiple pieces that were assembled kind of like a puzzle. :blobfoxgooglymlem:

That said, it was also an amazing learning experience and taught me about things to be extremely careful about, like don’t go too deep with the nesting of groups, and definitely don’t sprinkle deeply nested groups with the Kleene star or anything else that is unbound in length or repetition. :blobfoxscared: :blobfoxdeadinside:

(I still love #RegularExpressions for their power, though. :blobfoxgooglytrash: )

#RegularExpression #regexes #work

2024-12-26

Never before had I considered the importance of "greedy" and "lazy" options for #regular expression matches. By default, regular expression engines try to match the maximum of a chain of characters, but for years I used #regexes 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:

stackoverflow.com/questions/23

2024-02-23

@neustradamus #PCRE continues to be a misnomer; it’s a modified subset of #Perl #RegularExpressions with dozens of differences: pcre.org/current/doc/html/pcre

It's not "(C)ompatible." Accept no substitutes: perldoc.perl.org/perlre

#PCRE2 #PerlIncompatibleRegularExpressions #RegularExpression #RegExes #RegExps #regex #regexp

2024-02-10

@sparkman Some people, when confronted with another person solving a problem with #RegularExpressions, think, “I know, I’ll quote @jwz.” Now they feel clever without having to contribute anything.

#RegExes #programming #coding #SoftwareDevelopment

2023-11-17

@mort You can get pretty far with #Perl 5* #RegularExpressions. Here's @perlancar’s #CPAN module based on @randalschwartz’s minimal #JSON parser as a single #regex: metacpan.org/pod/JSON::Decode:

Full docs on conditional #regexes, including the special `(DEFINE)` form that merlyn used: perldoc.perl.org/perlre#condit

* #RakuLang hasn't been called #Perl6 for four years now. You're deadnaming the language.

2023-10-10
Jesus Castagnetto 🇵🇪jmcastagnetto
2023-08-10

Looking at some for , ended up going through the "bang-path" rabbit hole (user1!serv1!serv2!moreservs!someserv!user2) and other ancient stuff, finally finding: textfiles.com/humor/COMPUTER/m

2023-07-25

@profoundlynerdy I don’t know anything about #Rakudo’s internals, but Is there any conceivable way for a language-neutral subset of #RakuLang #regexes to be based on or share its code rather than reimplement them?

The subset might omit things like code interpolation. Or is it all-or-nothing?

It would be a nice teaser for the full power of Raku grammars, kind of like how #iTunes for Windows was #SteveJobs’ offer of “a glass of water to somebody in hell.” a.co/5J0CTSL

2023-07-25

@profoundlynerdy I don’t think other languages *have* “ripped off” #RakuLang #regexes and grammars. The point of a notional “RCRE” library would be to enable that.

2023-06-16

@malwareminigun @jernej__s #Perl has readability affordances for #regexes that nothing else can touch: perldoc.perl.org/perlre#%2Fx-a

2023-06-13

Congratulations @siegel and @bbedit for another great feature story on the #Mac #AppStore. "Where Respect Is Due," indeed!

apps.apple.com/us/story/id1435

Here are some earlier #BBEdit stories:

• Why it's the #TextEditor of choice for #coding, #writing, #DataScience, and more: apps.apple.com/us/story/id1433

• Tips for prose #writers: apps.apple.com/us/story/id1451

• Learn and experiment with #RegularExpressions for finding and modifying text in your actual work—safely! apps.apple.com/us/story/id1485
#RegEx #RegExes

2023-06-02

@regehr @commodore @dev There is even a (low-severity, a/k/a “cruel”) #PerlCritic policy to discourage everything but $_, @_, $], and numbered #RegularExpression capture variables: metacpan.org/pod/Perl::Critic:

metacpan.org/pod/Perl::Critic: already protects you against the performance-sapping $`, $&, and $' match variables

And you can configure your own prohibited list with metacpan.org/pod/Perl::Critic:

#Perl #RegEx #RegExp #RegExes #RegExps

2023-02-06

@Codely @drupler It helps to build your complicated #RegularExpressions 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.

Both #PHP and #JavaScript also support named capture groups if you’re doing replacements. They’re a lot more readable.

Also, PHP’s #PCRE-based engine has a PCRE_EXTENDED flag that lets you add whitespace, newlines, and comments.

#regexes #regexps

2023-01-23

@Perl Are you working through the #OReilly #book ‘Learning #Perl’? Get extra practice with co-author brian d foy’s ‘Learning Perl Exercises’ #ebook: leanpub.com/learning_perl_exer

Don’t have ‘Learning Perl’ yet? Buy it in paperback or ebook here: shop.aer.io/oreilly/p/learning
Prefer #Amazon #Kindle? amzn.to/3QZj7t6 (affiliate link)

#books #bookstodon #coding #programming #SoftwareDevelopment #ProgrammingLanguages #Perl5 #RegularExpressions #regexes #regexps #Unicode #CPAN

2023-01-22

@sjn @cb 99% of the “#Perl is line noise” complaints are because of unformatted #RegularExpressions. Every language worth anything eventually supports them, but only @Perl (and #awk, earlier) makes them first-class citizens. And with Perl you can format and comment them for readability: perldoc.perl.org/perlretut#Emb

We format the rest of our code for humans. Why not #regexps?

#PerlCritic can warn against bad regexps: metacpan.org/search?size=200&q

#regex #regexes #programming #coding #SoftwareDevelopment

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst