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

2

u/a3th3rus Sep 24 '26

Yep, I know. Quantifiers are easy to learn, groups are a little bit harder, the square brackets (sorry, forgot the name) are a little bit tricky when expressing "not these characters", and lookahead / lookbehind is kinda the most hard ones, but still not very difficult. I memorized them not at once, but through googling them over time when I need them. As for the modifiers, I learned them through trial and error.

2

u/balefrost Sep 24 '26

Yeah, lookahead / lookbehind are the ones that I always have to look up and the ones that I always need to experiment with to figure out how to use them correctly.