Reputation: 23
I've got the following awk script:
/^[0-9]\{2\}$/ { print "found 2 digits"; }
I am running with the following command line into gawk:
gawk -f script.awk data.txt
The data file is
aa
32
gh
I am expecting one instance of "found 2 digits" to appear on stdout but I'm getting nothing. Any ideas? It appears to be related to the quantifier of {2} after some experimentation.
Upvotes: 2
Views: 1082
Reputation: 455410
You need to specify --re-interval
option.
Alternatively you can also specify --posix
option.
Also you need to drop the \
from in front of {
and }
.
Upvotes: 4