Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Regular Expression Puzzles and AI Coding Assistants: 24 puzzles solved by the author, with and without assistance from Copilot, ChatGPT and more
Regular Expression Puzzles and AI Coding Assistants: 24 puzzles solved by the author, with and without assistance from Copilot, ChatGPT and more
Regular Expression Puzzles and AI Coding Assistants: 24 puzzles solved by the author, with and without assistance from Copilot, ChatGPT and more
Ebook303 pages2 hours

Regular Expression Puzzles and AI Coding Assistants: 24 puzzles solved by the author, with and without assistance from Copilot, ChatGPT and more

Rating: 0 out of 5 stars

()

Read preview

About this ebook

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 works: 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 Science: 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 A: Learning to use regular expressions
LanguageEnglish
PublisherManning
Release dateApr 11, 2023
ISBN9781638351887
Regular Expression Puzzles and AI Coding Assistants: 24 puzzles solved by the author, with and without assistance from Copilot, ChatGPT and more
Author

Mertz David

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 Science: Doing the Other 80% of the Work, and other books.

Related to Regular Expression Puzzles and AI Coding Assistants

Related ebooks

Intelligence (AI) & Semantics For You

View More

Related articles

Reviews for Regular Expression Puzzles and AI Coding Assistants

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Regular Expression Puzzles and AI Coding Assistants - Mertz David

    ebook_preview_excerpt.html[͒F~Aݒ,=mYa=&s,E B2=LI2  RFL[$PUYgճ6Z^=s啯ϝYdak|,m3aa~qˮyn\>TֶkhN>N믅V1/BƗU{zGOLލظw]9cvv%еƦE3^/B;3/V<\Ɲ¼uM>,t <5]*J{R+W@&<^FEhJR_u4ߥ-Nv_mۋR E\GUCM _9j?lę g3}k|qn^ȷbhrQDrUz̧šc*ܟ$CPجuvyoƗM+N,c1moq_o6gFGfw5?}Aevl#}1ٮˆiADqtqjIV=bJ3s&]p؆sƻ wu 6mcXzcP-6pO>VY6dH#3m}t}׍ۆ[TvMm/80ޮ6w/.*@5::qtEMp&WQm@Ε֗XF;@:^8!ֵJzqhq8j-V[nauv_`QG >[|KlT[{gaY_M/(bZ_n'60uk=IxR ;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