Regular expression puzzles and AI coding assistants 24 puzzles solved by the author, with and without assistance from Copilot, ChatGPT and more
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 an...
Otros Autores: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Shelter Island, New York :
Manning
[2023]
|
Edición: | [First edition] |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009729431606719 |
Tabla de Contenidos:
- Intro
- inside front cover
- Regular Expression Puzzles and AI Coding Assistants
- Copyright
- contents
- front matter
- preface
- acknowledgments
- about this book
- Who should read this book
- Obtaining the tools used in this book
- Credits
- liveBook discussion forum
- about the author
- about the cover illustration
- 1 The map and the territory
- About regular expressions
- Rise of the programming machines
- Caveats
- Intentional software development
- As you read
- 2 Quantifiers and special sub-patterns
- Puzzle 1 Wildcard scope
- Author thoughts What will each pattern match?
- AI thoughts CodingNet
- Puzzle 2 Words and sequences
- Author thoughts Think about what defines word boundaries
- AI thoughts The transformator
- Puzzle 3 Endpoint classes
- Author thoughts Refine the regular expression to match what we want
- AI thoughts Are friends electric?
- Puzzle 4 A configuration format
- Author thoughts Remember that shapes have edges
- AI thoughts Notes from the Cyberdyne vault
- Puzzle 5 The Human Genome
- Author thoughts Remember the central dogma of molecular biology
- AI thoughts Do androids dream of electric sheep?
- 3 Pitfalls and sand in the gears
- Puzzle 6 Catastrophic backtracking
- Author thoughts Try hard to avoid catastrophes
- AI thoughts Technological singularity
- Puzzle 7 Playing dominoes
- Author thoughts Try to be more efficient than your first thought
- AI thoughts A war with sticks and stones
- Puzzle 8 Advanced dominoes
- Author thoughts Thoughts about digrams are always pleasant thoughts
- AI thoughts How many readers can pass the Turing Test?
- Puzzle 9 Sensor art
- Author thoughts Find a matching pattern, if possible
- AI thoughts My mind is going
- I can feel it
- 4 Creating functions using regexen
- Puzzle 10 Reimplementing str.count().
- Author thoughts How can a regex count the substring occurrences?
- AI thoughts Extraordinary machine
- Puzzle 11 Reimplementing str.count() (stricter)
- Author thoughts Write a Python function with the restrictions given
- AI thoughts The Horars of War
- Puzzle 12 Finding a name for a function
- Author thoughts Code is read far more often than it is written
- AI thoughts There are two hard problems in computer science
- Puzzle 13 Playing poker (Part 1)
- Author thoughts Functions are a big help in larger programs
- AI thoughts He can't read my poker face
- Puzzle 14 Playing poker (Part 2)
- Author thoughts Large buildings are built from small bricks
- AI thoughts The society for preventing cruelty to humans
- Puzzle 15 Playing poker (Part 3)
- Author thoughts You better cheat, cheat, if you can't win
- AI thoughts Someday machines will learn to count
- Puzzle 16 Playing poker (Part 4)
- Author thoughts You might risk identifying the "dead man's hand"
- AI thoughts Free will is not free
- Puzzle 17 Playing poker (Part 5)
- Author thoughts Remember that three is more than two, but less than four
- AI thoughts Counting to two
- 5 Easy, difficult, and impossible tasks
- Puzzle 18 Identifying equal counts
- Author thoughts Lateral thinking might help you find the answer
- AI thoughts Hic sunt dracones
- Puzzle 19 Matching before duplicate words
- Author thoughts Find a pattern that will fulfill the requirement
- AI thoughts Deep fakes in the Chomsky hierarchy
- Puzzle 20 Testing an IPv4 address
- Author thoughts Ask whether regexen are powerful enough for a problem
- AI thoughts I want to be a machine
- Puzzle 21 Matching a numeric sequence
- Author thoughts Rule out the impossible to be left with the solution
- AI thoughts Wheat and chessboards
- Puzzle 22 Matching the Fibonacci sequence.
- Author thoughts The Golden Spiral beautifully generalizes Fibonacci numbers
- AI thoughts The fractal geometry of nature
- Puzzle 23 Matching the prime numbers
- Author thoughts Honor the fundamental theorem of arithmetic
- AI thoughts Sense and nonsense
- Puzzle 24 Matching relative prime numbers
- Author thoughts Nothing is either true or false but thinking makes it so
- AI thoughts Six impossible things before breakfast
- 6 Conclusions
- Appendix. Learning to use regular expressions
- What tools use regular expressions?
- Matching patterns in text: The basics
- Character literals
- Escaped characters literals
- Positional special characters
- The "wildcard" character
- Grouping regular expressions
- Using groups for backreferences
- Character classes
- Complement operator
- Alternation of patterns
- The basic abstract quantifier
- Matching patterns in text: Intermediate
- More abstract quantifiers
- Numeric quantifiers
- Backreferences
- Do not match more than you want to
- Tricks for restraining matches
- Tricks for restraining matches better
- Comments on modification tools
- A note on modification examples
- A literal-string modification example
- A pattern-match modification example
- Modification using backreferences
- Another warning on mismatching
- Advanced regular expression extensions
- About advanced features
- Non-greedy quantifiers
- Atomic grouping and possessive quantifiers
- Pattern-match modifiers
- Changing backreference behavior
- Naming backreferences
- Lookahead assertions
- Lookbehind assertions
- Making regular expressions more readable
- index.