News for hackers. Stuff that matters.
Re:Sculpting text with regex, grep, sed, awk, emacs and vim ... by comex on Tuesday July 29, 2014 @01:02AM (#8100755)
It depends on what you want to do. Even for simple text processing in one-liners, there are quite a few common tasks that are difficult in awk. A big one for me is capture groups in regular expressions:

    perl -ne 'print $1 if /foo="(.*?)"/' 
    awk '/foo=".*"/ { ??? }'
You can do it with gawk, but it's ugly:

    gawk 'match($0, /foo="(.*?)"/, a) { print a[1] }'
Another is manipulating hexadecimal numbers, which is also a gawk extension.

There are no comments on this comment yet.