$test = 'Max Muster foo-bar-sonstwas-oderauchnix>'; if ($test =~ /\@([^>]+)>/) { print "domain: $1\n"; }