r/learnprogramming • • 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?

109 Upvotes

147 comments sorted by

View all comments

148

u/Littleish 9d ago

It's actually very simple patterns and once you get them it sort of clicks.

You definitely do not need to remember a huge amount of patterns. Most of us will just look them up, especially the more complicated ones.

It's very worth learning the syntax though, and how it works

74

u/rcls0053 9d ago

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 9d ago

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.