this post was submitted on 14 Feb 2025
889 points (98.5% liked)
Programmer Humor
20717 readers
1804 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
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
So your use cases for regex are when you're not going to actually fix the problem that caused you to need regex?
Modifying software that might not be within the scope of the company that I work for, much less my team, on systems that I explicitly do not have authorization to make such changes on? No, I would not be doing that.
An important thing to remember is that going all-in on a given tool is going to result in a bad time. You suggestion of SQL, for example, excels in querying and modifying data that lives in a database and follows the expected structures in said database. Most data is not in databases, nor is it structured in a compatible manner, if at all. The workarounds needed to coax SQL into performing such tasks would result in syntax both more arcane and more verbose than the regex necessary to transform it into something compatible.
Use the right tool for the right job. For transforming semi-structured and unstructured data into something useful in a practical amount of time, regex is frequently the right tool.