my $pattern = '(\s*\w+\s+\d{2}\s*\d{4})|(Release\s+\d+\.\d+)';# to match only date #my $pattern = '((\s*\w+\s+\d{2}\s*\d{4})|(Release\s*\d+\.\d+))';# to match both date and release while() { print "$1\n" if($_ =~ /$pattern/ ); }