#!/bin/bashecho "xx yy [a1 b1] / zz [a2 b2]/" | awk '{p=gensub(/[^][]*\[([a-z0-9 ]+)\].*/,"\\1",1); print $2,p}'
Standard input is empty
yy a1 b1
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!