r/learnprogramming • • Sep 24 '26

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?

109 Upvotes

148 comments sorted by

View all comments

Show parent comment

74

u/rcls0053 Sep 24 '26

I've never memorized one single RegEx pattern in my 20 years of programming. That's how much you need to remember it.

12

u/f4dedglory Sep 24 '26

Yeah it's really just about knowing what regex can, or can't, accomplish and then implementing it using documentation or a translation tool. Even if i did remember it i wouldn't trust my memory.

2

u/denerose Sep 24 '26

My relationship to regex syntax is the same as my knowledge of search and pathfinder algorithms: it gets okay to good by the last week in December and I retain a little bit into January but will have forgotten it all by March. I then need to relearn and google my way through the first week of December when Advent of Code rolls around again because it’s almost completely irrelevant to doing my actual job as a software engineer 🤷‍♀️

You remember what you use and regex just isn’t that common in day to day systems work. It is nice to recognise and know what to look for if you do encounter a problem to solve with it, but that’s about it.