#!/usr/bin/perl use warnings; use 5.036; my $RE = qr/((?[ \w & ! [in] ])+)/; for my $data () { my $catch; say "$catch Match!" if ($catch) = $data =~ $RE; } __DATA__ abcdefghijklmnopqrstuvwxyz in words