3. Searching and Editing Text
This week …
Most of our work is not done interactively. We write things down as “code” in its broadest sense: just sequences of instructions and commentary on them. We need a good set of tools for editing and manipulating all the text we produce. So this week we will cover
- The idea of text search and manipulation via regular expressions
- Text Editors
Required Reading
- Jeffrey E F Friedl Mastering Regular Expressions, 3rd ed. (Sebastopol, CA: O’Reilly Media, 2006)., Chapter One
Background Material
The books on Vim and Emacs are only of interest if you plan on learning one or other of those editors, which I don’t necessarily recommend at this point. We’ll talk more in class about how you should think pragmatically about your choice of text editor.
- Arnold Robbins and Nelson H. F. Beebe Classic Shell Scripting (Sebastopol: O’Reilly, 2005).
- Drew Neil Practical Vim, 2nd ed. (Raleigh, NC: Pragmatic Programmers, 2015).
- Mickey Petersen “Mastering Emacs,” 2022, https://www.masteringemacs.org/book.
Examples
Assignment
This week’s assignment is an online regular expression tutorial.