Join David D. Levine for an in-depth discussion in this video A brief introduction to regular expressions, part of Learning vi.
…When you perform a search in vi, your search text is…interpreted as a regular expression, which is a special kind of…string containing meta-characters that stand for things other than themselves.…One meta-character is the period, which matches any single character.…For example, if you search for a.c, it matches abc,…axc or a space c or even a.c.…It'll match and a and a c with any single character in between them, but that period…stands for exactly one single character, so a search for a dot c does not match ac.…
Another important meta-character is the backslash.…The backslash character removes the special meaning…of the following character.…If you want to search for an actual period, you have to say backslash period.…So a\.c matches a.c and not a x c or a r c.…The backslash also removes its own special meaning.…So you have to say a\\c if you want to look for a\c.…The backslash also removes the special meaning of the slash character itself.…
Usually if you type another slash in the middle of a search that began with…
AuthorDavid D. Levine
- Entering and leaving vi
- Understanding the Command, Insert, and Colon modes
- Moving around in files
- Editing text
- Moving content with delete, yank, and put
- Searching with regular expressions
- Customizing vi
- Filtering text through shell commands
Skill Level Beginner
1. Exploring vi
What is vi?2m 26s
2. Getting Started with vi
3. Moving Around within a File
4. Basic Text Editing
5. Undo, Repeat, Yank, and Put
6. Search and Replace
7. Advanced Editing Features
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.