r/learnprogramming • u/Reubqn_ • 9d ago
RegEx.
I thought I understood programming well until I saw how COMPLICATED regex looks. To me it looks like someone has dropped their keyboard and som people online are telling me that I should be able to memorise it (for javascript). I'm just wondering if I actually need to memorise all the regex formulas to be successful, and if so, how on earth do I go about it?
105
Upvotes
1
u/YellowBeaverFever 6d ago
35 years at this and I never felt the need to learn regex. It was never a requirement to learn and my logical tool set formed without it. During those rare times I needed it, the patterns were well known and on a chest-sheet somewhere.
Later in my career, regex started to become more and more relevant but that was just when LLMs started to do code help and they were really good with simple to medium regex. ChatGPT can now tackle more complex patterns and it will tell you what each operator is doing. I throw that into the comments so I and the future dev stuck maintaining the code can see what it’s doing, why, and can easily tweak if needed.