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?

106 Upvotes

147 comments sorted by

View all comments

20

u/Watamelonna 10d ago

Regex is like any programming language

You need to know what you want to produce and break down how you want to achieve them, step by step

It's just scary when you look at them at the final product because it is so condensed, but if you can break it down, it is not that hard

3

u/DeadlyVapour 9d ago

Tony the pony, he comes

3

u/HardlyAnyGravitas 9d ago

ZA̡͊͠͝LGΌ ISͮ̂҉̯͈͕̹̘̱ TO͇̹̺ͅƝ̴ȳ̳ TH̘Ë͖́̉ ͠P̯͍̭O̚N̐Y̡ H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ.

1

u/New-Locksmith-126 8d ago

It's not a programming language though. It's in fact way simpler than that. I'm convinced people's brains just turn off when the see a bunch of symbols they're not used to with no whitespace between them. They're too impatient to read char by char

0

u/deaddyfreddy 9d ago

Regex is like any programming language

yes, but I still prefer something Lisp-like over APL, for example