This module discussed regular expressions, particularly when used with grep. You learned what regular expressions are as well as some of the metacharacters that
make up regular expression syntax. Using these metacharacters, you learned how to search for patterns based on their occurrence or position.
Because regular expressions usually contain characters that have special meaning to the shell, regular expressions must be quoted correctly.
You learned how to use single quotes, double quotes, and the backslash characters to ensure correct syntax.
This module introduced the following key UNIX characters:
Dollar sign (
Double quote (
Single quote (
This module introduced you to the following terms and concepts:
- anchor: An anchor is a metacharacter such as ^ or $ that restricts a match to a particular position.
- metacharacter: A metacharacter is a character with special meaning in regular expressions and is not treated literally. Examples include the * and . metacharacters.
- pattern matching: Pattern matching is the task of using regular expressions to search for text.
- regular expression: A regular expression describes a pattern using literal characters and optional metacharacters known as regular expression syntax.
- shell variable: A shell variable is a place to store data that is used by the shell.
- string: A string is a sequence of characters.
- wildcards: Wildcards are characters that the shell interprets in a special way. Wildcards create patterns for matching filenames. Examples include ?, *, and .
In the next module, you will learn to use the advanced features of the vi editor.
Click the Quiz link below to answer some questions about using grep with regular expressions.
Regular Expression - Quiz