Go to the first, previous, next, last section, table of contents.
A regular expression, or regexp, is a way of describing a set of strings. Because regular expressions are such a fundamental part of @command{awk} programming, their format and use deserve a separate major node.
A regular expression enclosed in slashes (`/')
is an @command{awk} pattern that matches every input record whose text
belongs to that set.
The simplest regular expression is a sequence of letters, numbers, or
both. Such a regexp matches any string that contains that sequence.
Thus, the regexp `foo' matches any string containing `foo'.
Therefore, the pattern /foo/ matches any input record containing
the three characters `foo' anywhere in the record. Other
kinds of regexps let you specify more complicated classes of strings.
@ifnotinfo Initially, the examples in this major node are simple. As we explain more about how regular expressions work, we will present more complicated instances.
Go to the first, previous, next, last section, table of contents.