this post was submitted on 14 Feb 2025
903 points (98.4% liked)

Programmer Humor

25448 readers
974 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
[–] Skyrmir@lemmy.world -5 points 5 months ago (8 children)

If you're needing that level of complexity in a text file search, you already fucked up by putting the data in a text file. There's a reason data file formats exist.

[–] potustheplant 5 points 5 months ago (7 children)

Not even close. Sometimes you can have a large text file where you need to do a find replace with a pattern. For example, in the translation world this can be a common occurrence for translation files (.xliff) or translation memories (.tmx).

There's a reason why this is widely used and it's not because everyone else but you is dumb.

[–] Skyrmir@lemmy.world -2 points 5 months ago (6 children)

Turns out the million hours of coding put into SQL, makes it a better option than regex, even for xml based files.

[–] potustheplant 4 points 5 months ago (1 children)

Maybe for your very specific use case that's true. However, other use cases exist and for many of those RegEx is the better option.

[–] Skyrmir@lemmy.world -1 points 5 months ago (1 children)

I'm saying if your use case makes regex the best option, you've gone the wrong way and should turn back. There are definitely corners you can paint yourself into that make it the way to go, but you've ended up there through a series of bad ideas.

[–] potustheplant 4 points 5 months ago

Maybe, just maybe, the context in which you use regex isn't the same as everyone elses. But hey, who am I to deny you the disservice of thinking you're the center of the world?

load more comments (4 replies)
load more comments (4 replies)
load more comments (4 replies)