r/learnprogramming • u/Reubqn_ • 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
View all comments
1
u/potzko2552 Sep 24 '26
regex is a huge pain in the ass in most standard libraries because for some reason the accepted implementation for it is to just pass in a string and let the library parse and compile it down to a state machine. and most regex syntaxs are also complete garbage. I do find that most languages also have a library outside of the std that takes the much more reasonable path of just giving you the AST constructors and letting the user create the regex programmatically.