in reply to Variable Length Parsing
probably an alternation like this
# perl -we '$x="somestring 12345 {ICMP}";$x=~/(.+({TCP}|{ICMP}))/ && p +rint "$1\n"' somestring 12345 {ICMP} [download]