Simple trouble with awk and regex

前端 未结 3 1195
半阙折子戏
半阙折子戏 2021-01-13 04:57
 echo xx y11y rrr | awk \'{ if ($2 ~/y[1-5]{2}y/) print $3}\'

Why I cannot get any output?

Thank you.

3条回答
  •  抹茶落季
    2021-01-13 05:10

    On my machine:

    $ echo xx y11y rrr | awk '{ if ($2 ~/y[1-5]{2}y/) print $3}'
    rrr
    

    Was this what you wanted? I'm using GNU awk 4.0.0 in Cygwin on Windows XP.

提交回复
热议问题