#! perl use strict; use warnings; my $text = 'pilar@delphoss.com type add (#090930-230011-907000 ur22122021 pi'; $text =~ /(\w+)@(\w+)\.com/; print "$1\@$2\n";