$_ = "caaat"; my @hits = m/(?:c(a)|k(t))/g; foreach (@hits) { print "|$_|\n" }