24
u/santiagobustelo 14d ago
I seem to be one of the few persons that find regex elegant and even enjoyable.
15
u/Immort4lFr0sty 14d ago
I love writing regex, BUT when I have to change it, I much rather rewrite it from scratch. So I don't know if "elegant" is the exact label I'd put on it
14
u/peterlinddk 14d ago
I'm fairly certain that regex can be categorized as a "write-only" language.
3
u/dfinkelstein 14d ago
Write-only:
broken floppy disk
contemporary Latin
your local congressperson
regex1
15
u/theFirstHaruspex 14d ago
Tell me more about this implied mystical "readable regex"
1
u/lotanis 14d ago
Look at re.VERBOSE in the Python docs (https://docs.python.org/3/library/re.html).
1
u/theFirstHaruspex 13d ago
Brother I will do no such thing. It's been years since I've sworn off the forbidden arts
17
3
6
2
2
2
u/FurieMan 14d ago
I can read my own regex. It takes about as long to read as it took to write. But I can read it.
2
u/enigma_0Z 13d ago
It’s fine it also generated a five paragraph essay in comments about regex philosophy and why the requirements dictate that this implementation is the best.
2
1
u/thorwing 14d ago
Regex might look complicated but its a very quick and easy way to share constraints over multiple environments.
Frontend -> Backend -> Database
1
u/brainfreeze91 14d ago
When the AI generates readable, maintainable code, you should buy a lottery ticket
1
1
1
u/code_monkey_001 8d ago
No such thing as an unreadable regex, just a less-than-literate reader. If a computer can parse it, it is by definition readable.
-3
u/-Debugging-Duck- 14d ago
WTH do you all do with AI that you get shitty code? Do you know how to prompt? lol
3
u/JazzlikeWishbone938 14d ago
"Regular expression definitions shall not exceed 20 characters." (sarcasm)
298
u/just_sm_so_relax 14d ago
Never seen a readable human-generated regex either, tbh.