foreach (keys %data) { next if ($_ =~ m!(?:^aaa$|/|^\(|and)! ); print "$_\n"; }