I have been a programmer for over a quarter of a century. And I used to think that I would never "get" regular expressions. Then one day about 6 or 7 years ago I realized I could write regular expressions correct about 80% of the time, after which it occurred to me that I now "get" regex. What changed?
I started using PhpStorm (or any JetBrain's IDE) and forced myself to use regular expressions to do search and replace. Because of how their UI works — it includes a preview of the result for each occurence when it asks if okay to replace — it basically trained me to grok regex.
So, trying to learn regular expressions only when you need to use one in your code will, if you are like me, leave you forever unable to become one with regex. But if you would like to learn the 20% of regex like the back of your hand that you'll use 80% of the time, grabbing a JetBrain's IDE (or maybe some other IDEs or text editors) and forcing yourself to use regex on almost every search is really all it takes.
Thanks for sharing the story Although I didn't use any special ide other than vscode, building ihateregex.io made me understand a lot of it. I can build my own expressions now.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I have been a programmer for over a quarter of a century. And I used to think that I would never "get" regular expressions. Then one day about 6 or 7 years ago I realized I could write regular expressions correct about 80% of the time, after which it occurred to me that I now "get" regex. What changed?
I started using PhpStorm (or any JetBrain's IDE) and forced myself to use regular expressions to do search and replace. Because of how their UI works — it includes a preview of the result for each occurence when it asks if okay to replace — it basically trained me to grok regex.
So, trying to learn regular expressions only when you need to use one in your code will, if you are like me, leave you forever unable to become one with regex. But if you would like to learn the 20% of regex like the back of your hand that you'll use 80% of the time, grabbing a JetBrain's IDE (or maybe some other IDEs or text editors) and forcing yourself to use regex on almost every search is really all it takes.
#jmtcw
Thanks for sharing the story Although I didn't use any special ide other than vscode, building ihateregex.io made me understand a lot of it. I can build my own expressions now.