For me, regular expressions are like the rules for boardgames that I don’t play that often: As the game progresses, I understand the rules and think I have a firm grasp on them, and when the game gets put away and I don’t play it for a while, I forget almost everything.
These days, I keep a couple of “interactive notebooks” with working code featuring useful regexes, paired with notes written in Markdown:
- For Swift, Xcode Playgrounds does this well.
- For other languages — Python, JavaScript, Kotlin, and C# — I used Jupyter Notebook.
One reply on “What scares many programmers?”
My go-to for this is https://regex101.com/, and use the interactive tooling there to build something up. Getting a regex correct is a great feeling though, and it never fails to feel like a super-badass, Neo rewriting the Matrix, programming move.
Also: https://imgs.xkcd.com/comics/regular_expressions.png