AWK Operators Regular Expression - AWK

What is AWK - Regular Expression Operators?

This example explains the two forms of regular expressions operators.

Match

It is represented as ~. It looks for a field that contains the match string. For instance, the following example prints the lines that contain the pattern 9.

Example

On executing this code, you get the following result −

Output

Not Match

It is represented as !~. It looks for a field that does not contain the match string. For instance, the following example prints the lines that do not contain the pattern 9.

Example

On executing this code, you get the below result −

Output

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

AWK Topics