this post was submitted on 28 Sep 2026
193 points (99.0% liked)

Programmer Humor

33371 readers
633 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS
 
top 11 comments
sorted by: hot top controversial new old
[–] rockSlayer@lemmy.blahaj.zone 8 points 2 hours ago
[–] naeap@sopuli.xyz 3 points 2 hours ago

At least the cat is happy again now after getting adopted

I'll forever be sad trying to understand the regex I've written myself...

[–] Aatube@lemmy.dbzer0.com 7 points 3 hours ago (2 children)

none of the meat of the regex shown, 0/10

[–] PumaStoleMyBluff@lemmy.world 2 points 19 minutes ago

Probably because showing your email regex publicly is a great way to get 1000 messages about obscure edge cases you're not handling 😛

[–] whats_a_lemmy@midwest.social 1 points 2 hours ago

One star. Too readable, would not write again

[–] akunohana@piefed.blahaj.zone 17 points 4 hours ago
[–] MaggiWuerze@feddit.org 4 points 2 hours ago

That's just sad expression with extra steps

[–] aMockTie@piefed.world 7 points 3 hours ago* (last edited 3 hours ago) (1 children)

Why waste time doing any matching if wantarray == false? Just do:

if(!wantarray) { return 1; }

Before any matching happens, or if you only want one return statement set the value of a variable in if(!wantarray)/elsif(regex) and return that variable at the end.

[–] marcos@lemmy.world 5 points 3 hours ago

That Perl. You never know if return doesn't have some kind of hidden behavior that uses the local variables...

Well, you could read the perldoc page on it. But you can't just assume it.

[–] sit@lemmy.dbzer0.com 2 points 2 hours ago

Doggy is not smiling but trying to lose heat. Doggy is the real regular expression

[–] death_to_carrots@feddit.org 1 points 3 hours ago

If regular expressions are your solution, than your problem is wrong.