Hey everyone! I'm really struggling to get the hang of regex. I've attempted to learn it multiple times, but it just never sticks. Are there any resources or tools you recommend that might help me, perhaps something with quizzes or an interactive game to make it more engaging? Thanks in advance!
5 Answers
My biggest tip is to use tools that let you represent regex without writing it out in that terrible syntax. Like in Emacs Lisp, there's `rx`, which is way more readable and helps avoid some of the headaches with regex's complexity.
Try to keep your regex patterns simple, but don’t hesitate to add complexity when necessary. Just remember to take notes because you'll likely forget how it worked after a while. Also, using regex101 to create clear test cases has been a game-changer for me.
Great advice! I’ll definitely make a point to take notes and use regex101.
Honestly, you don't need to master regex. Just know the basics to quickly make simple queries. Using regex101 for pattern searches makes it so much easier than memorizing everything.
Thanks for the tip! If I find myself using a pattern frequently, I guess I’ll learn it naturally.
Check out regex101.com and regexper.com; they're fantastic resources. You won't need much more than those two to get started with regex and see how it works in practice!
Learning about deterministic finite automata really helped me understand regex better. If you can grasp how state machines work, regex will seem a lot less daunting!
Good point! I should look into DFA more!
Absolutely! The dragon book is a classic for learning about these concepts.

Yeah, I totally agree about regex syntax being a pain! I'm also searching for a cheat-sheet to make it easier.