GAWK-specific regular expression operators
GAWK has some more regular expression operators, in addition to those we've already discussed. The operators described in this section are specific to GAWK and are not available in other AWK implementations. These are basically shorthand character classes that are frequently used, and most of them deal with word matching (here, word refers to a sequence of one or more letters, digits, or underscores). We access them by using the escape character, '\'
, followed by a letter (here, the escape character adds special meaning to them instead of taking it away).
Let's create a file to practice GAWK-only operators:
vi gopr.txt start bigstarting starting start end white space example e d end e_d e1d e;d eNd white space example with tab e d
Matching whitespaces
Whitespaces matches anything that is considered a whitespace character. It is equivalent to '[[:space:]]'
.
For example, in the gopr.txt
file, we match all the lines that contain 'e'
followed by whitespace...