In this section, you will learn about regular expressions and why we use them. Then we will discuss the usage of regular expressions in AWK.
Introduction to regular expressions
What is a regular expression?
A regular expression, or regexpr, is a set of characters used to describe a pattern. A regular expression is generally used to match lines in a file that contain a particular pattern. Many Unix utilities operate on plain text files line by line, such as grep, sed, and awk. Regular expressions search for a pattern on a single line in a file.
A regular expression doesn't search for a pattern that begins on one line and ends on another. Other programming languages may support this, notably Perl.