http://www.perlmonks.org?node_id=1007092


in reply to pick a word contaning reg-ex

You mean something like this:

use warnings; use strict; while(<DATA>){ chomp; print grep{/.+?\!/} split } __DATA__ Mary had a little lamb! , whose fleece! was white! as snow. And everywhere! that Mary went, the lamb was sure! to go.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me