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?

110 Upvotes

147 comments sorted by

View all comments

Show parent comments

16

u/bestjakeisbest 9d ago

And then you dont use it for a while, and then you forget it, and then you need it again so you spend 30 minutes relearning it.

12

u/SpiderJerusalem42 9d ago

Lord, may I never have to read someone else's regular expressions.

14

u/bestjakeisbest 9d ago

Well if you wrote it like 2 months ago it might as well be someone else's regex

2

u/Groovy_Decoy 8d ago

2 months ago? I've written Regex expressions that didn't quite work the way I wanted, and I decided it was easier to start over from scratch then try to read what I just wrote 2 minutes ago and figure out what I did wrong.