O'Reilly logo

Learning AWK Programming by Shiwang Kalkhanda

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Matching words (\w)

Matching everything that is considered a word character, this can be done using \w. It is the equivalent of any letter, digit, or underscore as [[:alnum:]_]. Here, the underscore is included because in many programming languages, the underscore is used as a variable or function name. For example:

$ awk '/e\wd/' gopr.txt

The output on execution of the preceding code is as follows:

start endende_de1deNd

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required