GNU Info

Info Node: (gawk.info)Pattern Overview

(gawk.info)Pattern Overview


Next: Using Shell Variables Prev: Patterns and Actions Up: Patterns and Actions
Enter node , (file) or (file)node

Pattern Elements
================

Regexp Patterns
Using regexps as patterns.
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.
   Patterns in `awk' control the execution of rules--a rule is executed
when its pattern matches the current input record.  The following is a
summary of the types of patterns in `awk':

`/REGULAR EXPRESSION/'
     A regular expression. It matches when the text of the input record
     fits the regular expression.  (Note: Regular Expressions.)

`EXPRESSION'
     A single expression.  It matches when its value is nonzero (if a
     number) or non-null (if a string).  (Note: Expressions as
     Patterns.)

`PAT1, PAT2'
     A pair of patterns separated by a comma, specifying a range of
     records.  The range includes both the initial record that matches
     PAT1 and the final record that matches PAT2.  (Note: Specifying
     Record Ranges with Patterns.)

`BEGIN'
`END'
     Special patterns for you to supply startup or cleanup actions for
     your `awk' program.  (Note: The `BEGIN' and `END' Special
     Patterns.)

`EMPTY'
     The empty pattern matches every input record.  (Note: The Empty
     Pattern.)


automatically generated by info2www version 1.2.2.9