Join David D. Levine for an in-depth discussion in this video Using character classes and quantifiers, part of SED Essential Training.
- In a regular expression a set of characters…between square brackets…matches any single character in the set.…For example, a[xyz]c matches any string…in which a A and a C…have exactly one character between them.…And that character is an X, a Y, or a Z,…a lowercase x, y, or z.…This series of characters between square brackets…is called a character class.…In this case, the characters in the class…are lowercase x, y, and z.…
So a[xyz]c matches axc.…It also matches ayc, or azc.…But it does not match axyzc,…because the bracketed expression xyz…represents a single character…chosen from that set.…So for example,…we can replace t-h-e,…followed by the bracketed expression…m or y with uppercase YOU globally…in our dukeofyork file.…
This looks for a lowercase t-h-e,…followed by a lowercase m, or a lowercase y.…Wherever it finds it on any line…it replaces that t-h-e-m,…or, t-h-e-y,…with uppercase Y-O-U.…So for example, in line three…He marched them up to the top of the hill…becomes He marched YOU up to the top of the hill.…But, in the line, And when they were up they were up,…
AuthorDavid D. Levine
- Understanding input, output, files, and pipes
- Modifying the "s" command
- Using character classes and quantifiers
- Controlling printing
- Reading and writing files
- Appending, inserting, and editing entire lines
- Writing programs in SED
- Using advanced programming commands
Skill Level Intermediate
1. Sed Command-Line Basics
2. Regular Expressions
Using & and \n5m 34s
3. Sed Command-Line Flags
4. More sed Commands
5. Writing Programs in sed
Exiting with "q" and "d"3m 5s
6. Advanced Programming Concepts
- 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.