perl -le'while() { print $1 if /^$ARGV[0]:([^:]*):$ARGV[1]:/ }' #### perl -le'while() { print $1 if /^\Q$ARGV[0]\E:([^:]*):\Q$ARGV[1]\E:/ }'