Learn how AI-assisted coding using ChatGPT and GitHub Copilot can dramatically increase your productivity (and fun) writing regular expressions and other programs.
Regular Expression Puzzles and AI Coding Assistants is the story of two competitors. On one side is David Mertz, an expert programmer and the author of the Web's most popular Regex tutorial. On the other are the AI powerhouse coding assistants, GitHub Copilot and OpenAI ChatGPT.
Here's how the contest David invents 24 Regex problems he calls puzzles and shows you how to tackle each one. When he's done, he has Copilot and ChatGPT work the same puzzles. What they produce intrigues him. Which side is likelier to get it right? Which will write simple and elegant code? Which makes smarter use of lesser known Regex library features? Read the book to find out.
David also offers AI best practices, showing how smart prompts return better results. By the end, you'll be a master at solving your own Regex puzzles, whether you use AI or not.
About the technology Groundbreaking large language model research from OpenAI, Google, Amazon, and others have transformed expectations of machine-generated software. But how do these AI assistants, like ChatGPT and GitHub Copilot, measure up against regular expressions—a workhorse technology for developers used to describe, find, and manipulate patterns in text. Regular expressions are compact, complex, and subtle. Will AI assistants handle the challenge?
About the book Regular Expression Puzzles and AI Coding Assistants is the perfect starting point for programmers of any experience level who want to understand the capabilities—and the limitations—of these exciting new tools. Author David Mertz presents 24 challenging regex puzzles, their traditional human-made solutions, and the fascinating answers given by popular AI assistants. Alongside these eye-opening puzzles you’ll learn how to write prompts, integrate AI-generated coding suggestions, and interact with the assistant to get the results you want. By the end of the book, you'll have a clear understanding of where AI assistants can reliably write code for you and where you’ll still need a human touch. Plus, you’ll learn a lot about regular expressions!
About the reader Code examples use simple Python and Regular Expressions. No experience with AI coding tools required.
About the author David Mertz is the founder of KDM Training and an acclaimed contributor to the Python community. He is also the author of The Puzzling Quirks of Regular Expressions, Cleaning Data for Effective Data Doing the Other 80% of the Work, and other books.
Table of Contents 1 The map and the territory 2 Quantifiers and special sub-patterns 3 Pitfalls and sand in the gears 4 Creating functions using regex 5 Easy, difficult, and impossible tasks 6 Conclusions Appendix Learning to use regular expressions
This is a fun technical book to read. It is about regular expression puzzles, AI coding assistants, and whether the latter can be successfully used to solve the former. The author has come up with 24 cool regex puzzles and challenges the reader (as well as Copilot and ChatGPT) to solve them. The puzzles are nothing like those boring exercises readily available on the Internet, and I speak from experience of somebody who used to teach using regular expressions to college students in my NLP and Python classes. The puzzles are very diverse: from dominoes to poker to genomics to prime numbers.
It is a sharp and focused book. You should probably read it if you can tick at least any two of the following boxes:
- [ ] I like regular expressions - [ ] I want to learn more about regular expressions - [ ] I like AI coding assistants - [ ] I want to learn more about the usefulness and limitations of AI coding assistants
If you can tick three or more, this book is a must read for you. Its style is witty and refreshing. It feels like a friendly conversation with a very smart guy who happens to be a well-known contributor in the Python community. With this book, I managed to both learn something new about regular expressions AND also had a good time.
This book is undeniably captivating, particularly due to its remarkable potency. It explores a vast array of possibilities, leaving no room for limitations, and emphasizes the indispensability of Regular Expressions across programming languages.