Go forward to Actions.
Go backward to One-liners.
Go up to Top.
Patterns
********
Patterns in `awk' control the execution of rules: a rule is executed
when its pattern matches the current input record. This chapter tells
all about how to write patterns.
Menu
- Kinds of Patterns
- A list of all kinds of patterns.
The following subsections describe
them in detail.
- Regexp
- Regular expressions such as `/foo/'.
- Comparison Patterns
- Comparison expressions such as `$1 > 10'.
- Boolean Patterns
- Combining comparison expressions.
- Expression Patterns
- Any expression can be used as a pattern.
- Ranges
- Pairs of patterns specify record ranges.
- BEGIN/END
- Specifying initialization and cleanup rules.
- Empty
- The empty pattern, which matches every record.