z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Matching operators

z/OS UNIX System Services User's Guide
SA23-2279-00

If the pattern in an instruction is just a regular expression, awk looks for a matching string anywhere in a record. Sometimes, however, you want to look for a matching string only in a particular field of a record. In this case, you can use a matching expression.

There are two types of matching expressions:
string ~ /regular-expression/
Is true if string matches the given regular expression. (The ~ character is called a tilde.)
string !~ /regular-expression/
Is true if string does not match the given regular expression.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014