Chapter 4. Regular Expressions

Many UNIX programs, languages, editors, and shells use regular expressions. They are a way of describing a set of strings through pattern-matching. When you use the expression, “That's cool,” you are not presenting literal information on the temperature of the object. You probably are trying to indicate that the object is good, or interesting, or well done, or acceptable, or neat, or…cool.

Similarly, expressions are used by the shell and by utilities to represent an aggregate of string information in a succinct manner.

This chapter teaches you the following:

  • The value of regular expressions in scripts

  • How to represent groups of characters through character classes

  • How to use special pattern-matching characters

Get Korn Shell Programming by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.