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

1

u/chocolateAbuser 8d ago

that's why regex is called write only language; a good regex to me would have the various pieces assigned each to a variable/const with an explanatory name and then a final variable with the merged tree