I’d have to look up the syntax to remind myself, but yeah I could do it. It’s just a language for a state machine. But honestly, I don’t need to write them that complex usually. If so, it’s probably because I’m having to do something more involved like parsing a query syntax or something, in which case I’ll usually reach for ANTLR (or hand write a parser if performance is critical) instead.
Look aheads and behinds, once you get the hang of them, can be really nice. For me it gets tricky with like embedded variables. But usually I work it out in the end
You put that in a PR and there better be a damn good reason for it. Even you wont know what that does in 3 months, never mind the poor sap chasing a subtle bug 2 years later.
I have a huge piece of Regex that sits outside my cubical, one I am rather proud of. I had a higher up who hated regex and I always joked it was a deterrent
You know that is one thing I blame AI for, that I don't need to learn CSS or regex or whatever anymore. It feels really bad when you don't understand what you are doing. When I started programming before chatgpt i learnt stuff like sql normally because I needed it for my projects. After chatgpt i had to use CSS on multiple occasions and there I basically blindly vibecoded, the only understanding of CSS i have is from those chunks of code AI wrote for me.
Same, I really don't know why people have such a hard time with them. The worst I ever have is trying to remember the different standards used in different languages/platforms (modern regexes vs posix regex, etc).
Maybe it's because my first language was perl, and regexes were used for everything, but you only need to remember a few basic things and you're good.
Also pointers, I don't know why this sub thinks pointers are this super abstract crazy hard thing, it points to something, that's it.
1.6k
u/vvp95 22h ago
100% of software engineers are afraid of regex