This is an experimental “book” about regular expressions. It is largely visual and example-based, as opposed to most regex resources I found while I was learning. I also attempted to choose test cases that highlight some common gotchas. I think it’ll be worth your time.
This book’s intended audience is regex beginners. Some programming experience is assumed. It does not go into advanced regex concepts like engine backtracking and recursive regexes—at least not at the moment.
This is also an open source project, and contributions are welcome.
“Learned more in just the first few pages than I have in my many years of copy-pasting regex from StackOverflow. Cheers” —digitalmaster
“Incredible resource - I liked the structured approach as opposed to guess and check regex which is what most tools offer” —scottfits
“This looks like a great resource! Like others, I vastly prefer an example-based style, and the examples are really well chosen and very illustrative.” —twicetwice
“I like the example based approach. I learn from examples far quicker than I learn from ‘explanations’. If I attempt to learn from an example and my brain hits an exception, only then do I start reading the supporting text. […]” —LeonBRead the full discussion at Hacker News.
Translations are welcome, as long as they adhere to the license.
You can choose to publish your translation separately, but we welcome translations on here too!
A single-page version of the book is available. Print it ordinarily. Make sure to enable “Print Background Colors” on Firefox and “Background graphics” (under “More settings”) on Chrome.