my @hits; while ( m/(?:c(a)|k(t))/g ) { push @hits, defined $1 ? $1 : $2; }