this post was submitted on 18 Dec 2024
217 points (97.8% liked)

Programmer Humor

19809 readers
1095 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 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Skullgrid -1 points 1 day ago (19 children)

I swear to god,someone must have written an intermediary language between regex and actual programming, or I'm going to eventaully do it before I blow my fucking brains out.

[–] BassTurd 6 points 1 day ago (16 children)

How do you think that would look? Regex isn't particularly complicated, just a bit to remember. I'm trying to picture how you would represent a regex expression in a higher level language. I think one of its biggest benefits is the ability to shove so much information into a random looking string. I suppose you could write functions like, startswith, endswith, alpha(4), or something like that, but in the end, is that better?

[–] [email protected] 1 points 18 hours ago (1 children)

string.contains("something")

Just do that repeatedly

[–] BassTurd 1 points 14 hours ago

The "something" is where the regex goes. For simple cases contains by itself does just fine, but for almost anything kind of dynamic input, it's going to not be capable of what regex does.

load more comments (14 replies)
load more comments (16 replies)