this post was submitted on 15 Jul 2026
76 points (98.7% liked)
Programmer Humor
42841 readers
279 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 7 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Isn't the whole point of regex to toil for 3 hours to write something very specific you will only ever use once?
Tap for spoiler
It's a Regex that checks if the letters for the word "yes" exists within a text in order. I call it the yesnometerWhat's wrong with
y.*e.*s?Nothing is wrong with that, but it will give you different output. I tend to like using capture groups just out of habit, it makes it more flexible and useful in future. Most of my co-workers hated Regex so I tried to make it easy for them.
I also wanted the letters to be as close together as possible. In this example it doesn't matter, but in other texts it might. Yours will find the first y, then the furthest possible e, then the furthest possible s. So you might get output where there's a y on line 1 and the e s at the very end of the text. Nothing wrong with that, it's just not what I was envisioning.
Also it's funnier in this context to have a complicated regex.